Skip to content

Commit

Permalink
[SCSI] nsp_cs: fix buf overflow
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
jirislaby authored and James Bottomley committed Aug 22, 2009
1 parent a2cf8a6 commit edced19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/pcmcia/nsp_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit edced19

Please sign in to comment.