]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hns: Use kmalloc_array() in hns_roce_cmd_use_events()
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 16 Feb 2017 07:50:11 +0000 (08:50 +0100)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Apr 2017 20:31:49 +0000 (16:31 -0400)
commite64c527124fe7e92c1be3d70c6bc89ec73a8a2f6
tree3e33fe5c47a339e58b7d61ee93541f6781b374af
parent62a65a29dc38e4b2c76da601f2d82866ef81cd22
IB/hns: Use kmalloc_array() in hns_roce_cmd_use_events()

* 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>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_cmd.c