Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1503926
| From | "David Härdeman" <david@hardeman.nu> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx() |
| Date | 2016-10-19 17:40 +0200 |
| Message-ID | <su18d-37s-11@gated-at.bofh.it> (permalink) |
| References | <ss99U-JJ-39@gated-at.bofh.it> <qEuGl-43C-5@gated-at.bofh.it> <ss99T-JJ-1@gated-at.bofh.it> <ss99U-JJ-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] [media] winbond-cir: Fine-tuning for four function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
[PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
Re: [PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:40 +0200
Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 18:30 +0200
[PATCH 5/5] [media] winbond-cir: Move a variable assignment in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
Re: [PATCH 5/5] [media] winbond-cir: Move a variable assignment in two functions "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
[PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection Sean Young <sean@mess.org> - 2016-10-15 15:40 +0200
Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-15 18:50 +0200
Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 18:30 +0200
Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
[PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
Re: [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:40 +0200
[PATCH 3/5] [media] winbond-cir: Move assignments for three variables in wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
Re: [PATCH 3/5] [media] winbond-cir: Move assignments for three variables in wbcir_shutdown() "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:30 +0200
Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:50 +0200
Re: [media] winbond-cir: Move a variable assignment in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
csiph-web