All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] [SCSI] aic7xxx: Use kmemdup rather than duplicating its implementation in ahc_loadseq
@ 2018-09-14  2:38 YueHaibing
  0 siblings, 0 replies; only message in thread
From: YueHaibing @ 2018-09-14  2:38 UTC (permalink / raw)
  To: kernel-janitors

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index f3362f4..8549f1e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -6901,10 +6901,10 @@ struct ahc_softc *
 	if (cs_count != 0) {
 
 		cs_count *= sizeof(struct cs);
-		ahc->critical_sections = kmalloc(cs_count, GFP_ATOMIC);
+		ahc->critical_sections = kmemdup(cs_table, cs_count,
+						 GFP_ATOMIC);
 		if (ahc->critical_sections = NULL)
 			panic("ahc_loadseq: Could not malloc");
-		memcpy(ahc->critical_sections, cs_table, cs_count);
 	}
 	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-14  2:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-14  2:38 [PATCH -next] [SCSI] aic7xxx: Use kmemdup rather than duplicating its implementation in ahc_loadseq YueHaibing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.