diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c index 1810b62457bc16f2f6159e8051ec4b6363a8d60f..e7c00b6796364d99ded7a2c2dd575835c4046348 100644 --- a/drivers/staging/greybus/bundle.c +++ b/drivers/staging/greybus/bundle.c @@ -102,6 +102,11 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id, { struct gb_bundle *bundle; + if (bundle_id == BUNDLE_ID_NONE) { + dev_err(&intf->dev, "can't use bundle id %u\n", bundle_id); + return NULL; + } + /* * Reject any attempt to reuse a bundle id. We initialize * these serially, so there's no need to worry about keeping diff --git a/drivers/staging/greybus/bundle.h b/drivers/staging/greybus/bundle.h index 2dc61ab7495d5c448ca699ab0d0d81540dbcfaeb..3895f94f43c42111242e252fbc85df43cb788844 100644 --- a/drivers/staging/greybus/bundle.h +++ b/drivers/staging/greybus/bundle.h @@ -12,6 +12,8 @@ #include +#define BUNDLE_ID_NONE U8_MAX + /* Greybus "public" definitions" */ struct gb_bundle { struct device dev;