Commit ef5aa934 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

staging: rts5208: rtsx.c: Fix invalid use of sizeof in rtsx_probe()

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 2eb9d8cb ("staging: rts5208: rtsx.c: Alloc sizeof struct")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d298ec65
...@@ -884,7 +884,7 @@ static int rtsx_probe(struct pci_dev *pci, ...@@ -884,7 +884,7 @@ static int rtsx_probe(struct pci_dev *pci,
dev = host_to_rtsx(host); dev = host_to_rtsx(host);
memset(dev, 0, sizeof(struct rtsx_dev)); memset(dev, 0, sizeof(struct rtsx_dev));
dev->chip = kzalloc(sizeof(dev->chip), GFP_KERNEL); dev->chip = kzalloc(sizeof(*dev->chip), GFP_KERNEL);
if (!dev->chip) { if (!dev->chip) {
err = -ENOMEM; err = -ENOMEM;
goto errout; goto errout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment