From patchwork Tue Sep 26 13:35:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9972047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1253660393 for ; Tue, 26 Sep 2017 13:36:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CCE828881 for ; Tue, 26 Sep 2017 13:36:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0198228883; Tue, 26 Sep 2017 13:36:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBB14288FD for ; Tue, 26 Sep 2017 13:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030876AbdIZNgH (ORCPT ); Tue, 26 Sep 2017 09:36:07 -0400 Received: from mout.web.de ([212.227.17.12]:55624 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030262AbdIZNgG (ORCPT ); Tue, 26 Sep 2017 09:36:06 -0400 Received: from [192.168.1.3] ([78.49.148.35]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MHowb-1dw14u2px7-003dBL; Tue, 26 Sep 2017 15:35:53 +0200 Subject: [PATCH 2/2] [media] dmxdev: Improve a size determination in dvb_dmxdev_add_pid() From: SF Markus Elfring To: linux-media@vger.kernel.org, Devendra Sharma , Mauro Carvalho Chehab , Sakari Ailus , Thomas Gleixner Cc: LKML , kernel-janitors@vger.kernel.org References: <5f169dcb-b834-5ca3-2195-668e5295a7ca@users.sourceforge.net> Message-ID: Date: Tue, 26 Sep 2017 15:35:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <5f169dcb-b834-5ca3-2195-668e5295a7ca@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:B+LND82XV6bW0YoUJbMBBLP9rAalD/B7D6Fcyoli/FxdWZgrnuh /WMaHBSlRRsLflMsIE5CDfA5qxENpYtqgwN7iLFSNLFukrr1HoDs4KOSWU2DgzUSTNDNyvn aGBs3W0ZCqr3HvK7iWSm1QYgfONHsgi2eHhIi3IWFESnKISlfhcfGSPER+GkWDVcW8AlY4L wcszl1b+/5IWx2awAGMjA== X-UI-Out-Filterresults: notjunk:1; V01:K0:IaIb5nBpNms=:jNPvQOHRxqpFhQ/WJBUuFi RQvX9GJPZTFY4kgy3siWkjR0HXJO94FZHxyG4jSJ0HowEpTNHuxKzQhvgRffCY6zHnMzp6jtl rCS4L0fB3NthttGaPZ410S5kskpE+WoUa4VNdK2IkinekJOwzpHkVGrSSMFVSYcwIAS+CaHQ2 OfAdSdquIrI4lol92xXOEHEuxq9iorR6ghoYO0s/wnB3DKEXZwppPK3icSw+X0gbgLkUkfaZG l+IE0mh8+MLejPQD+IMnDLQvcnSrLDQ0kH4WaQRsOMqjYUHIHqDZ0vJ5Le/u84on/Yj9Zu84D UKvoawHr4HlnJ4Nxwr/vTBtd6hYweD+sEkgNQBVvTeQEXjVeo0g53NaoAyaNrEvSOWz9TuADL O6tCm6SHKW1ZTpwHYvSY8u30gg6WTQMVTi/VCATRaPVcnmIBNYUrFZBybqEbfUYgH+c4T/nst dVDuwiu1H6KkeyxPci3hSz9BoNvnAhZIS2t+bTdN4l32Vo55iKn0LjNBPAmhrE1kPNtjXfVVV 5lHIS/P5tO2SktpthAWCEtHiyA6lP+rCe9QKMeY3C0yvld4omqhEj/G3r/FRpWcfXI9EJylPE S9kwVwsdBF0Mmz/+dqDtiPAzFv5Svz464zVAunjamOwM0stzWRWSO5jjti8SpyX67lGAgugPJ a6zkJNJwQSVdKUH7ODqiUo5dOIhyp4bg2eWDLbMvIH64ozQYQhje2xJ5V0NKnOr3uqMHYkK6w CRbRlD4wbkA/75tQoLUqQpzerC01/0C4MwfhD1R7Rr1V5KRpElIBG10zZlMvhBeGaXwzcBHmG Hb3Q8lzXARFvHaf43PkreaTyG6VnygP/ShdqBzFjqXHmu2VDas= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 26 Sep 2017 15:22:57 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/dvb-core/dmxdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index f8bf7459d5ca..8e0f91775fe4 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -809,7 +809,7 @@ static int dvb_dmxdev_add_pid(struct dmxdev *dmxdev, (!list_empty(&filter->feed.ts))) return -EINVAL; - feed = kzalloc(sizeof(struct dmxdev_feed), GFP_KERNEL); + feed = kzalloc(sizeof(*feed), GFP_KERNEL); if (feed == NULL) return -ENOMEM;