Message ID | 74b439c6-fa6f-1f78-424a-ebeb6c8bbb4f@users.sourceforge.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
October 14, 2016 1:41 PM, "SF Markus Elfring" <elfring@users.sourceforge.net> wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Fri, 14 Oct 2016 07:19:00 +0200 > > A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "kmalloc_array". > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Sure...why not... Signed-off-by: David Härdeman <david@hardeman.nu> > --- > drivers/media/rc/winbond-cir.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c > index 95ae60e..59050f5 100644 > --- a/drivers/media/rc/winbond-cir.c > +++ b/drivers/media/rc/winbond-cir.c > @@ -660,7 +660,7 @@ wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count) > unsigned i; > unsigned long flags; > > - buf = kmalloc(count * sizeof(*b), GFP_KERNEL); > + buf = kmalloc_array(count, sizeof(*b), GFP_KERNEL); > if (!buf) > return -ENOMEM; > > -- > 2.10.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 95ae60e..59050f5 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -660,7 +660,7 @@ wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count) unsigned i; unsigned long flags; - buf = kmalloc(count * sizeof(*b), GFP_KERNEL); + buf = kmalloc_array(count, sizeof(*b), GFP_KERNEL); if (!buf) return -ENOMEM;