Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934130AbcJQXf7 (ORCPT ); Mon, 17 Oct 2016 19:35:59 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35260 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932756AbcJQXf6 (ORCPT ); Mon, 17 Oct 2016 19:35:58 -0400 From: Wei Yongjun To: Greg Kroah-Hartman , Lars-Peter Clausen , Sergio Paracuellos , Dilek Uzulmez , Jonas Rickert , Wayne Porter , Amitoj Kaur Chawla , Sandhya Bankar , MingChia Chung Cc: Wei Yongjun , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH -next] staging: rts5208: rtsx.c: Fix invalid use of sizeof in rtsx_probe() Date: Mon, 17 Oct 2016 23:35:49 +0000 Message-Id: <1476747349-10737-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 851 Lines: 24 From: Wei Yongjun sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Fixes: 2eb9d8cbb3c3 ("staging: rts5208: rtsx.c: Alloc sizeof struct") Signed-off-by: Wei Yongjun --- drivers/staging/rts5208/rtsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index f3e5efd..68d75d0 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -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;