From patchwork Wed Oct 4 13:34:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9984739 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 407A460365 for ; Wed, 4 Oct 2017 13:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3408D28A69 for ; Wed, 4 Oct 2017 13:35:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2893C28A8B; Wed, 4 Oct 2017 13:35:53 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 C8F7B28AC1 for ; Wed, 4 Oct 2017 13:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752183AbdJDNfj (ORCPT ); Wed, 4 Oct 2017 09:35:39 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:49744 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752008AbdJDNfi (ORCPT ); Wed, 4 Oct 2017 09:35:38 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LxXtj-1dG9EN2Uhf-017Ft3; Wed, 04 Oct 2017 15:35:16 +0200 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Arnd Bergmann , stable@vger.kernel.org, Philipp Zabel , Steve Longerbeam , Hans Verkuil , Mauro Carvalho Chehab , Steve Longerbeam , Mauro Carvalho Chehab , Russell King , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] [STABLE-4.13] [media] imx-media-of: avoid uninitialized variable warning Date: Wed, 4 Oct 2017 15:34:55 +0200 Message-Id: <20171004133507.3539072-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:0ZFxIuAoIFLeVgpe/OoZkc0ulSzo74QwUlexDmuQP2YjYevVZRx qfc2Ybq1jKHjwYUsI2EcenaSCyKl/neD9nHsc0NAkNXtSYOdfe0DaIZnyj0WiFTPje7GEct NUoEkMCWx8XyJDoLnIXT5CL47OIF0ML2n1+kdpAy0aQQbU2B7HSFVApBuOm3IUTbWf6OgS5 c+FBjrJXj4Jg4bf5Ms2Ig== X-UI-Out-Filterresults: notjunk:1; V01:K0:V4SRNWLZinU=:JLFd0n22bqAnDIgyq+j19i P1/7YzV5dLjEyEKLxW9mLvzMbjQK43tx0EosIMzKXs0D34skWwUebmSs3F2tPzTKi1MkskMk/ rDOslEB5NmIZ4WS6hLd2/LIiHh5caLfbmZ2lir5pOlGRqrCV8QX5ixEGf3BA3W5k3Hl9Ts7rZ BKryXYVlWNkOkIwjlEkv7HJEqWvnhVTsf8I3LLB8QMtlLFremtMKHwpECcdSvsTseQrjgwlsD qaJ31vtdrSi/6ruRQlE2SVZ6n3Myk5W0Ku9yfjAjrp9odX9jXkhl4jHLYoqkKsWRz4U+tqWKY 0i9oKFis58qoqb0yeraApP1u5a9DnQmws0AG/7+DiDTzwoJGqQV1btq6s0gpcs4k9o1ULNoqK EazdJYRqdwgD8CCGcKknsIbC+qYrQDQyY5wFAkWZkbnf+6JJgq+ljXZ+pBOiGl8MpcpRNI/cI 6Fa0tk0rVncZRNZ/XZO2+mmX4ljDJsdu43rOKB34ah3nJ0tIHa+tkn3Z6x6I/OK5IQSUrULQ/ RtTjdgYUZjslSQx2B8wkTRAq6FFHWkOY/hLg3OtcJoIC9Wy2Z50z2FeBmLn36k4Xti06Qn9y1 THTHnXY40sE3EdJf5+Zj0hM9fA51TCs/JrGBRUi3nJTRSRkwdKs5Wd/uHzYOR1rxZeG6AXJ4F e3HBnYPbEzqsIQOsIpcUbAIlcU9TIyX4x0ykCWF4zHPXX9+9/SfBhaHJSVhAjG+fJah/3RFYB lcPxDWZVzQnsp3kmfC0vrt97SUc4rmYc2Cg+nw== 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 Replaces upstream commit 0b2e9e7947e7 ("media: staging/imx: remove confusing IS_ERR_OR_NULL usage") We get a harmless warning about a potential uninitialized variable use in the driver: drivers/staging/media/imx/imx-media-of.c: In function 'of_parse_subdev': drivers/staging/media/imx/imx-media-of.c:216:4: warning: 'remote_np' may be used uninitialized in this function [-Wmaybe-uninitialized] I reworked that code to be easier to understand by gcc in mainline, but that commit is too large to backport. This is a much simpler workaround, avoiding the warning by adding a fake initialization to the variable. The driver was only introduced in linux-4.13, so the workaround is not needed for earlier stable kernels. Fixes: e130291212df ("[media] media: Add i.MX media core driver") Cc: stable@vger.kernel.org Cc: Philipp Zabel Cc: Steve Longerbeam Cc: Hans Verkuil Cc: Mauro Carvalho Chehab Signed-off-by: Arnd Bergmann --- drivers/staging/media/imx/imx-media-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c index b026fe66467c..90e7e702a411 100644 --- a/drivers/staging/media/imx/imx-media-of.c +++ b/drivers/staging/media/imx/imx-media-of.c @@ -167,7 +167,7 @@ of_parse_subdev(struct imx_media_dev *imxmd, struct device_node *sd_np, of_parse_sensor(imxmd, imxsd, sd_np); for (i = 0; i < num_pads; i++) { - struct device_node *epnode = NULL, *port, *remote_np; + struct device_node *epnode = NULL, *port, *remote_np = NULL; struct imx_media_subdev *remote_imxsd; struct imx_media_pad *pad; int remote_pad;