From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:46092 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756867AbdJJT7v (ORCPT ); Tue, 10 Oct 2017 15:59:51 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Zabel , Steve Longerbeam , Hans Verkuil , Mauro Carvalho Chehab , Arnd Bergmann Subject: [PATCH 4.13 001/160] [media] imx-media-of: avoid uninitialized variable warning Date: Tue, 10 Oct 2017 21:48:49 +0200 Message-Id: <20171010190548.826121308@linuxfoundation.org> In-Reply-To: <20171010190548.690912997@linuxfoundation.org> References: <20171010190548.690912997@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/imx/imx-media-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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 *im 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;