提交 edced191 编写于 作者: J Jiri Slaby 提交者: James Bottomley

[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: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 a2cf8a63
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册