From patchwork Mon Jan 15 08:11:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10163253 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 01D6A601C0 for ; Mon, 15 Jan 2018 08:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE8CD2891E for ; Mon, 15 Jan 2018 08:12:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2A8F28920; Mon, 15 Jan 2018 08:12:16 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 60F572891E for ; Mon, 15 Jan 2018 08:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932077AbeAOIMN (ORCPT ); Mon, 15 Jan 2018 03:12:13 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:34878 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753838AbeAOIMK (ORCPT ); Mon, 15 Jan 2018 03:12:10 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0F8Bwdx009602; Mon, 15 Jan 2018 08:11:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=1p2pngrUOm9HxA6q6tOG+/pRdlGlMPvGuMqn7XMxRec=; b=nQLMuQh1CZgtlZICTUb1kaRfMaaHklP9YcC7y6U4vysyF/OWxeP5BcaMGZBYGV3DI654 2i9OEwFCI/y3ZcmdN2iEpizjwLvlGPZA0gel6H+L0pLmSSn7dfVoDzdT7IvD/n5DQ39l HpoDevykzokJoFiw8HxC4FbpwDqjW6jVONmeahZyOQUU15tWuvIc6Xa4477yDF5TS9cZ yOwpWS2dg/0sCUShJzu6rQ/FXVVs1fIzhWOJ2JdJR/7LhC10eJbUv9UNFF/ztxDMZT94 ppFyQuO4Zm2ibze0o8+c8Kj63EKxsA3g3qVC5cj+Goet0CeHwc/dSJm629FFspN++8da KA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2fgq17891v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jan 2018 08:11:58 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0F8Bvxo016389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 Jan 2018 08:11:57 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0F8Bu8C010542; Mon, 15 Jan 2018 08:11:57 GMT Received: from mwanda (/41.202.241.27) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Jan 2018 00:11:56 -0800 Date: Mon, 15 Jan 2018 11:11:47 +0300 From: Dan Carpenter To: Steve Longerbeam , Arnd Bergmann Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] media: staging/imx: Checking the right variable in vdic_get_ipu_resources() Message-ID: <20180115081147.upana3zubsxp4vvd@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8774 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801150121 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 We recently changed this error handling around but missed this error pointer check. We're testing "priv->vdi_in_ch_n" instead of "ch" so the error handling can't be triggered. Fixes: 0b2e9e7947e7 ("media: staging/imx: remove confusing IS_ERR_OR_NULL usage") Signed-off-by: Dan Carpenter Acked-by: Steve Longerbeam diff --git a/drivers/staging/media/imx/imx-media-vdic.c b/drivers/staging/media/imx/imx-media-vdic.c index 433474d58e3e..ed356844cdf6 100644 --- a/drivers/staging/media/imx/imx-media-vdic.c +++ b/drivers/staging/media/imx/imx-media-vdic.c @@ -177,7 +177,7 @@ static int vdic_get_ipu_resources(struct vdic_priv *priv) priv->vdi_in_ch = ch; ch = ipu_idmac_get(priv->ipu, IPUV3_CHANNEL_MEM_VDI_NEXT); - if (IS_ERR(priv->vdi_in_ch_n)) { + if (IS_ERR(ch)) { err_chan = IPUV3_CHANNEL_MEM_VDI_NEXT; ret = PTR_ERR(ch); goto out_err_chan;