From patchwork Sun Sep 24 10:28:54 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: 9967875 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 5D7216020C for ; Sun, 24 Sep 2017 10:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DC3C28B94 for ; Sun, 24 Sep 2017 10:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4150328D36; Sun, 24 Sep 2017 10:29:38 +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 EAE5428B94 for ; Sun, 24 Sep 2017 10:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbdIXK3X (ORCPT ); Sun, 24 Sep 2017 06:29:23 -0400 Received: from mout.web.de ([212.227.15.14]:61905 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbdIXK3V (ORCPT ); Sun, 24 Sep 2017 06:29:21 -0400 Received: from [192.168.1.2] ([78.48.160.4]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lp7Lg-1dQ3Fu0XTA-00ey05; Sun, 24 Sep 2017 12:29:06 +0200 Subject: [PATCH 4/6] [media] omap_vout: Fix a possible null pointer dereference in omap_vout_open() 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: <15332564-0c8d-a197-b987-f54e29768e56@users.sourceforge.net> Date: Sun, 24 Sep 2017 12:28:54 +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:/S3dAsyDv0iQVhhpyTkBJG7GPjp0vQcxWxVJ2kWJBrT5RijhzL6 8mdwdmJlw76eMNaHqPMnYnnG3KcwhEfTqgQMXpe9cLyHw3lHMGjmb/Xco31GucmI0dziXfH R5QaN87XZMSt6HUXA1NsMJz17ZKUtrpV39PEQk22A5PL1nKrA06/ctY8G83/eO3NtyuZyFK I7detQDoDogAtTukKUZUA== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZKqR6uBdpf4=:KnNHUhMqXDxbzoMGgV2QgP R826RW+QQ3pmOHBxAZkdi4mkN82SFd2X06OrDBKQ9d3to8NDekbzX49t1sF7gOQMddL2bGrZe +f9lXUyrEfi0VFv3+hCKUTSHyGGYVODwau6IjtEMwx/yAhvwGvkKthueS9yoswVLeGwY6pjp0 r/Qc9TsiysE31nOWYrH2XTMsI/SCcTp2AVNHVraV3izE8lhNVshv/49UZFaW5FM18I59b7oey VqPbp3h1sbcSbnl3QHDo+tDDdxvJSUNG3/PSMoPGgB1W68txmPKuqpVVzJ4KvSBOOvhySORlO ha4r3fF1NKdYEnFLZYhNjo8cyvjmjojeaggiTPDWqF7DXGotwI835qEqrSlC5fDdrHFHxQpkO wlqVM4lfxzAIaEnezLcYZowkRmYPYt6eMWKQ+k0DJa+qS2FPLvoEo8y0ZnQuQ0BJO5jLQjzrl 6YdZL4YS7VtEOvLLhtK6I1aubAUqpYnM3bpK5YyG85KWgO4uV+iiAiFZR8R2AQmxauk88N/Ol bja5DOmwp1Qscdbtdy1C3IV5eqOxZEcswrD3MJHbzD5bd+1VXvbbsHSgtX7p/XcMyFZ6ELXUp ogTGw4asNAgqTrt27v0QkceBq8nV9b2r9JgsMkESqE0BPqecLJvSCsltkMp/f1bjDSCUdckRr lTe7qiwYtS/iiS18ctWnltwT+JK4t/bZcm9DznRuWZ1WrI72T8sG2ewgzpltcb2a9/g0rqUOr O7UR9AT38/q4gP2PepCQVSm0bqj+oW+DlgP6fv0SGjNZO5yjJyxEQ1WWllKVTpnQerbcee5R/ 0XC5I244388gkEnoSbpZY6wtatx4bY19Gf5XqFB4dJL8tppl7c= 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 11:00:57 +0200 Move a debug message so that a null pointer access can not happen for the variable "vout" in this function. Fixes: 5c7ab6348e7b3fcca2b8ee548306c774472971e2 ("V4L/DVB: V4L2: Add support for OMAP2/3 V4L2 display driver on top of DSS2") 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 2b55a8ebd1ad..71b77426271e 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c @@ -1004,11 +1004,11 @@ static int omap_vout_open(struct file *file) struct omap_vout_device *vout = NULL; vout = video_drvdata(file); - v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__); - if (!vout) return -ENODEV; + v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__); + /* for now, we only support single open */ if (vout->opened) return -EBUSY;