From patchwork Sun Sep 24 10:26:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9967871 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 D0A466020C for ; Sun, 24 Sep 2017 10:27:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B6928B94 for ; Sun, 24 Sep 2017 10:27:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6CA028D35; Sun, 24 Sep 2017 10:27:25 +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 8F2ED28D36 for ; Sun, 24 Sep 2017 10:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbdIXK05 (ORCPT ); Sun, 24 Sep 2017 06:26:57 -0400 Received: from mout.web.de ([212.227.15.14]:65459 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbdIXK0u (ORCPT ); Sun, 24 Sep 2017 06:26:50 -0400 Received: from [192.168.1.2] ([78.48.160.4]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MeSYJ-1djE3e0Ovn-00QAp4; Sun, 24 Sep 2017 12:26:37 +0200 Subject: [PATCH 3/6] [media] omap_vout: Adjust a null pointer check in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Jan Kara , Lorenzo Stoakes , Mauro Carvalho Chehab , Michal Hocko , Muralidharan Karicheri , Vaibhav Hiremath Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <28d2db5e-0cc3-04eb-16d6-0b6f0ecfe19c@users.sourceforge.net> Date: Sun, 24 Sep 2017 12:26:35 +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: Content-Language: en-GB X-Provags-ID: V03:K0:FNseIk/xdvLFlI131a3WMhLr6eVQJxdflCQqi/WsOT9USNnNkNu P1j6fCidyQesAw8tDxTOdRpfdvt3L/D9bBDhdL5MUzPuSdCtB89CJI9N/1/qW+skLCnydBh bfHtSq2hs8XRNUHAbhHYljUFF3vV2MpzPksEyIvfEl8NVMAPa/fS8VGebL/SgEbvMvse9ff +sq2b6aXIKIWvr8pELAkA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mLNMo+FdaM0=:aKkLlBmEssoGugxpMl6Bp8 jw7nrW+Io6D8jmSKXup59sBisu2GXZL6tOMh8PU/I+bKuHnBNLPzngLlqMfUp495f5hOM6rXI l6aPg+SAoNbIfYA2JlKm3mq1Rj4ycdeyAaG/ixZt5yrh+VEGp0Vq762U5MhfDl1QrlzTpnS2O olBCsV+0anElVG4K4kX9vIYFy5w1uvMD36dKQ+uCQyZYWkgtZvVSaaK1D4xqc7P77jDk1D/8p KQ1qcoubNxi8u3reNbtq5jXkSRIfRNt3pafoF0lndRqSo3vTHGslIF4TPPidgAFyneJ4n4wQd W45waMiaCAqg8GVBDtwpkL6GUMJ3nZMaXbakSvOAJcAjYiAK5I+3i43yN2bbL+yklGEchJUzy y+/obvEG/8GJiJRm5RxPZtal/8N18JsF8M4qj7pRqYjxQr8a0akupepVgHfNuGvcmI0/87XIY 53+eF65JbTj6GC0TznxOyOUNoAbMRzMoeJKUDLzE0yA+IMCVemNxunQlxkDw9WFMRyVrcIs79 KxtB4+YSpStW1IPt6sHyTjjtvf8IIe/sSVutj8SdLmbwsILHvZdg+rYL69+yiPTxLO4hN0hJa Zj5YBXX6D/7IIPn2o8d2CTZOlwkiVoTfXhnJZldT0FaYs14uiIT+p58ORLHvtmciWHHq2S/me TFTFCZdafknqJZ7LRAvcb8EnlQczK3+HsxiRkX0DiIVB4ahWBnbVPa/OA7zndRyGsOg5RA93k lR3H8WLym7JgkyJjlzC2drUSUbsqIrIvtxqybyKjmARPVqc/s3lK6++sPAAjhLmWDHPsQ8aX0 CFfKDXnP+eGmr11vKUK4ilsBz2zTEwEQKmsI5T6Tb3GOAW42PI= 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: Sun, 24 Sep 2017 10:30:29 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/platform/omap/omap_vout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 4a4d171ca573..2b55a8ebd1ad 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c @@ -1006,7 +1006,7 @@ static int omap_vout_open(struct file *file) vout = video_drvdata(file); v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__); - if (vout == NULL) + if (!vout) return -ENODEV; /* for now, we only support single open */ @@ -2095,7 +2095,7 @@ static int __init omap_vout_probe(struct platform_device *pdev) } vid_dev = kzalloc(sizeof(*vid_dev), GFP_KERNEL); - if (vid_dev == NULL) { + if (!vid_dev) { ret = -ENOMEM; goto err_dss_init; }