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: 2eb9d8cbb3 ("staging: rts5208: rtsx.c: Alloc sizeof struct")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Wei Yongjun 2016-10-17 23:35:49 +00:00 committed by Greg Kroah-Hartman
parent d298ec6580
commit ef5aa934cf
1 changed files with 1 additions and 1 deletions

View File

@ -884,7 +884,7 @@ static int rtsx_probe(struct pci_dev *pci,
dev = host_to_rtsx(host);
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) {
err = -ENOMEM;
goto errout;