From patchwork Wed Oct 12 14:57:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9373389 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 246B160865 for ; Wed, 12 Oct 2016 15:03:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1624628459 for ; Wed, 12 Oct 2016 15:03:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A8D029DA7; Wed, 12 Oct 2016 15:03:26 +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=ham 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 7D46F284BD for ; Wed, 12 Oct 2016 15:03:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932835AbcJLO7M (ORCPT ); Wed, 12 Oct 2016 10:59:12 -0400 Received: from mout.web.de ([212.227.15.3]:53637 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754954AbcJLO6s (ORCPT ); Wed, 12 Oct 2016 10:58:48 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MOlTq-1boIZ40pcM-006BBQ; Wed, 12 Oct 2016 16:57:52 +0200 Subject: [PATCH 19/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open() To: linux-media@vger.kernel.org, Hans Verkuil , "Lad, Prabhakar" , Mauro Carvalho Chehab References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <87108e91-1b2e-ec8f-4fed-4fb4eb105688@users.sourceforge.net> Date: Wed, 12 Oct 2016 16:57:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:cpriIEprDuS+30wPuxtmZYDec6tKi7Ze1Lr0pJ6Znb4EG/MLy6i G8IOtl8HMZ3NKBML/l+FrrtT5lZBHpqW/8bW3DKxRTyxvtA6cX0lTrbkv8GicTBPuuEIGWl 64WhKNaxbpy1yeCTWFP6tAcgBBTrb6gBRnJrR69p+PARWNFTGXyjFjRjL0VrF9Q07z/6qTa G2DtMhs/p97lgwDeB+Iuw== X-UI-Out-Filterresults: notjunk:1; V01:K0:+EHf5V76GN4=:aVFzgqlb1LUTTV6OeTwe/n trSrT0Xh0pHeHyUG9v5expMy5pZm4NmP2Y7DQSUWTXPad09jnQ+bafq/307qySBawlKSjVX+/ aO3L6RhHUMK3JqhFeBDAK7i89LY9RCsJLDr/Uu/V7N9jLvx8GNlGX1Pqg0I1hTbD6fKv9L9DX VdHLM6zxTIibaNZyCkrCxJybZYBTmDiyE+1IVV00IkSmZ0mIDU4HQrtFeQk2RO1qpC8rNGy5K LgPmbUGAHuUai6J4qhl+gpuDxAPYuXAT9q92bdqqgZlSMA+vEQY62cJhszoYuZ5twAEemxQv/ 6jNSZfGVQflC/OXmbVfEYFMMbXSoxLlPfT47yfpOLw5Mv8DtaGHCyN2BD757ijlSIRlpK5fVH GdxPwpIEEN2YjhxpSlDpTKTKrixe66DcCL685HM2PWCnF3sTtnFdY+UfNiCMx4zWfuXXdaE/k +J7BUp7ARJd3MJyNgUG/7ZzDRQx769mWUYK4n9je8b+iN7RYcmZZ5oJkoxNFU0jPbH85tR3ta 8poRhB0Tntomr0NYJq56P5V0V8njTV0yWCR+BiSvUETPilRebdW0f4eCG/vuHafqvzL0esc5R n3FFx2SFrsVIRHIDvHVq8v9P3jDiI5fWzhLLpalmaMbLCKDP3FHBTBxvrC986DNJ+BjAo8pRF 8CdIPhn1e24k5Kvred9apYKJ2PxcDcA1hx75tzkHnXLOt4qtija5xFdY8lKfe0jHvooxGOsc3 Bebz84IOHj6B0ZZ8nVhZZUL/X9kn4HfAyY7mjsaFg70qqzyDE7BRVkRu3yWYiLn3g0MxjIpD8 SEdFnin 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: Wed, 12 Oct 2016 10:44:05 +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. Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpfe_capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index ee7b3e3..e370400 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -511,7 +511,7 @@ static int vpfe_open(struct file *file) } /* Allocate memory for the file handle object */ - fh = kmalloc(sizeof(struct vpfe_fh), GFP_KERNEL); + fh = kmalloc(sizeof(*fh), GFP_KERNEL); if (!fh) return -ENOMEM;