kmemdup has implemented the function that kmalloc() + memcpy().
We prefer to kmemdup rather than code opened implementation.
This issue was detected with the help of coccinelle.
Signed-off-by: Wen Yang
CC: Hannes Reinecke
CC: "James E.J. Bottomley"
CC: "Martin K. Petersen"
CC: linux-scsi@vger
Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.
Signed-off-by: Muhammad Falak R Wani
---
drivers/scsi/aic7xxx/aic7xxx_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
2 matches
Mail list logo