aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/nsp_cs.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-08-08 05:36:06 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:52:22 -0400
commitedced191e4512b7795380563634f4d44b21c684a (patch)
tree890c3863601cecdbce624eab70cc8e2e7dacf901 /drivers/scsi/pcmcia/nsp_cs.c
parenta2cf8a6306c89223d0ed35a7e9d40da99902e32a (diff)
[SCSI] nsp_cs: fix buf overflow
In nsp_cs_config there is a wrong struct nsp_cs_configdata allocation. It allocates only sizeof(pointer to nsp_cs_configdata) for a whole structure. Add a dereference to the sizeof to allocate sizeof(nsp_cs_configdata). Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/pcmcia/nsp_cs.c')
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 70b60ade049e..e32c344d7ad8 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1713,7 +1713,7 @@ static int nsp_cs_config(struct pcmcia_device *link)
1713 1713
1714 nsp_dbg(NSP_DEBUG_INIT, "in"); 1714 nsp_dbg(NSP_DEBUG_INIT, "in");
1715 1715
1716 cfg_mem = kzalloc(sizeof(cfg_mem), GFP_KERNEL); 1716 cfg_mem = kzalloc(sizeof(*cfg_mem), GFP_KERNEL);
1717 if (!cfg_mem) 1717 if (!cfg_mem)
1718 return -ENOMEM; 1718 return -ENOMEM;
1719 cfg_mem->data = data; 1719 cfg_mem->data = data;