mmc: core: Use kmalloc_array() in mmc_alloc_sg()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 8 Jan 2017 21:10:40 +0000 (22:10 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 Feb 2017 12:20:11 +0000 (13:20 +0100)
commit63928d4789ebb3f7d35d9261089b3bcc98ae0632
tree5acb8abf5669b3e2abfe88770d7e56ad4b025531
parent3972a20b51c8bb887d13f5656d6fa93bf3d4fc46
mmc: core: Use kmalloc_array() in mmc_alloc_sg()

* 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.

* Replace the specification of a data structure by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/queue.c