mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SCSI: pcmcia, fix buf overflow
@ 2009-08-08  9:36 Jiri Slaby
  0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2009-08-08  9:36 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, linux-kernel, Jiri Slaby, YOKOTA Hiroshi

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>
Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
---
 drivers/scsi/pcmcia/nsp_cs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 70b60ad..e32c344 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)
 
 	nsp_dbg(NSP_DEBUG_INIT, "in");
 
-	cfg_mem = kzalloc(sizeof(cfg_mem), GFP_KERNEL);
+	cfg_mem = kzalloc(sizeof(*cfg_mem), GFP_KERNEL);
 	if (!cfg_mem)
 		return -ENOMEM;
 	cfg_mem->data = data;
-- 
1.6.3.3


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

only message in thread, other threads:[~2009-08-08  9:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-08  9:36 [PATCH] SCSI: pcmcia, fix buf overflow Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®