diff --git a/drivers/staging/ozwpan/ozpd.h b/drivers/staging/ozwpan/ozpd.h index 57e98c897711..996ef65ed315 100644 --- a/drivers/staging/ozwpan/ozpd.h +++ b/drivers/staging/ozwpan/ozpd.h @@ -48,8 +48,8 @@ struct oz_farewell { struct list_head link; u8 ep_num; u8 index; - u8 report[32]; u8 len; + u8 report[0]; }; /* Data structure that holds information on a specific peripheral device (PD). diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index 084307a1083f..3d1a89f07355 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -291,7 +291,7 @@ static void oz_add_farewell(struct oz_pd *pd, u8 ep_num, u8 index, struct oz_farewell *f; struct oz_farewell *f2; int found = 0; - f = kmalloc(sizeof(struct oz_farewell) + len - 1, GFP_ATOMIC); + f = kmalloc(sizeof(struct oz_farewell) + len, GFP_ATOMIC); if (!f) return; f->ep_num = ep_num;