Received: by 10.223.185.116 with SMTP id b49csp5966183wrg; Wed, 7 Mar 2018 22:50:14 -0800 (PST) X-Google-Smtp-Source: AG47ELvUpeT5F/KW98S41/YaKTrurTgkqTEqUbmsckGFO1Mq43tVRvc1iFmS7ZZ2vRVXrsZdY8Bk X-Received: by 2002:a17:902:6b4c:: with SMTP id g12-v6mr22717636plt.363.1520491814664; Wed, 07 Mar 2018 22:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491814; cv=none; d=google.com; s=arc-20160816; b=Zme+jibIKLnyvqaCaDnxVLDzHTBKQWWIwI7TVy4nVSI9bIJ7tQi0DKSS5fvueGzmtG 64CaDSJ/YCDCWXSF6M8+mlT+jJ1/5sMim57w29dNtQ5yLEXgBy2kTFIrvAGQcQ0DWtdP 2qDmqWS/3StRvN0rjwSgme8mwWOSEVYc98c2LhUKPaVsH4xbm65gU8rE3M3bzUsYokw9 8Kib35lR2113yjlIlr22hwHAcZJlkR2iGduYKFEq+Rj19sTGNGT6tCc20tKNyK4LPkdW NFqZ3DnJpENKQyoJzPwAwWh6iNFKkNCX+aBVsZddodYSc0M3lml3ckO++V+8hLkb1Kpr cY0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=losky8f6qbjt2Id6JpIcqhCSbrY1P5tbB96Juhhxb6k=; b=t3C8IF1peuvbalPH9amkOyJloa6DLjtUxioOGvbTxQ4r9WqqRBLNbBa6rtC4BYl7PD Eha6NM7xx+JY4p3v3LHNOS48Grx9fjyc/jhjxDmW1UdB710MIYCJkFbitPp6vEOark+T VhGlm2W3YsEzLCXzCqbk2+PDa8tP4YVdbazV9T1KKtzaWb323ZFm/sDKt2/Us5zosI89 oWsMXrbtm5ctXrINunsDgyayPiNz+mm/7ryeqDAuv6UCLwIl/asIooNl387mf6Khr6gI cTgrNjwgLW6Ig/fehH3fGgldh26fT9Xnu75+vSTJNqJomdo/n9bvNE8ddLjQcvsPmObv +Rig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=UXKQPaM6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si12568591pgp.7.2018.03.07.22.50.00; Wed, 07 Mar 2018 22:50:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=UXKQPaM6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965091AbeCHE6Q (ORCPT + 99 others); Wed, 7 Mar 2018 23:58:16 -0500 Received: from mail-sn1nam02on0119.outbound.protection.outlook.com ([104.47.36.119]:48736 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935224AbeCHE6N (ORCPT ); Wed, 7 Mar 2018 23:58:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=losky8f6qbjt2Id6JpIcqhCSbrY1P5tbB96Juhhxb6k=; b=UXKQPaM6wBxUqZChrDuFxb1LMn7IGbXO4wdtUR2FrY4zYDaKIvmPqF59BlCzZLdJm7WwxYzDbujPZY1dkEbR3Jk23twuLiWc1FPx50HeZxSb0pcuQ5df2xQxmxLGCA7k9JhgQEmYC7zj/Cg8Ff0aXyjL/hmQSi0KSm9JbUbQgEw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:58:04 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:58:04 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: "Gustavo A. R. Silva" , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 05/67] media: c8sectpfe: fix potential NULL pointer dereference in c8sectpfe_timer_interrupt Thread-Topic: [PATCH AUTOSEL for 4.14 05/67] media: c8sectpfe: fix potential NULL pointer dereference in c8sectpfe_timer_interrupt Thread-Index: AQHTtpn47cYujzlU5kye4G/3ssq2Dg== Date: Thu, 8 Mar 2018 04:57:33 +0000 Message-ID: <20180308045641.7814-5-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0936;7:E5wenbtZ5++aX6b06fd3zAwMP0Ri3vMK7uOuMwEyPnHJi1GdBP+7Y+j9pQTwDISY+/huvlK8RjgVh4LxBZ4Quia2/a2AkanArUoSveGoaVHiHMzm2atZSPEq399OuJ1k8RJ2uqYu58HUpmRrUvPqL6xhYX6moDvJZkyxV3BgHJ1ZzjNRY8zCPNA5ljhdCbtM53z1N0VSJvctJZEnONVI+yHglyKm7vk75gOBrciJhHgp4JQ+fqx4OM2ZR3sqcB60;20:b0rBCgNn0emiYp+u2r73uyjJ20mKznkso9DXOHMt7Y02olPFGvDCYp//FrpQqcYFgTiqqLz1VD7ChnM4o6FjeXeI08LNFis3jmvESnz+Xa3kJ29zFtHo2gj/FU5PJiL8NQlD3caJrLNopo3XtCusquLxKcjlQZmVwRxz4tQ0f80= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 81b0731f-9230-41b3-0ff2-08d584b12cef x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(346002)(376002)(199004)(189003)(478600001)(99286004)(575784001)(6506007)(59450400001)(3660700001)(36756003)(86362001)(54906003)(6116002)(110136005)(2950100002)(102836004)(1076002)(3846002)(6486002)(3280700002)(15760500003)(10090500001)(10290500003)(305945005)(72206003)(6436002)(6666003)(26005)(5250100002)(2906002)(186003)(2501003)(105586002)(76176011)(66066001)(7736002)(68736007)(25786009)(6512007)(106356001)(86612001)(8936002)(107886003)(81166006)(2900100001)(5660300001)(4326008)(81156014)(53936002)(14454004)(97736004)(316002)(22452003)(8676002)(22906009)(32563001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0936;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: o9MF2/yMl//qAPQaQdWMj2dvX673f9ypPPxpk6veoTmgQUpNRbTv7n06TOb55EZ6tbNzW5xsdhm7cyDsmFMBTD0goI+KO+1iAWSvNUCN7i1KLqZQu4aT1hsCnjSTfYdrs4sarTrdgj/j8LgU10D/7DnMeWrGsWvDpEyCXuvZZqCCBLwITuS4sT4YQQVegfzkkLlQXYwsmKca53hDGnpAjofT0cjLPXQpk/GkbD5fCvhTbVwCz1rzkKFDF5XuzMbJHS2Je8UWWN3uyvME01bfBpJzRsFhVbF6FhBr8oifOlgnRxStF+ZkquHis4s98pVIJQSM//yD7uyOXLFOzpXhoQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81b0731f-9230-41b3-0ff2-08d584b12cef X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:33.5432 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gustavo A. R. Silva" [ Upstream commit baed3c4bc4c13de93e0dba0a26d601411ebcb389 ] _channel_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer derefere= nce after _channel_ has been null checked. This issue was detected with the help of Coccinelle. Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support= ") Signed-off-by: Gustavo A. R. Silva Acked-by: Patrice Chotard Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/driver= s/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 59280ac31937..23d0cedf4d9d 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -83,7 +83,7 @@ static void c8sectpfe_timer_interrupt(unsigned long ac8se= ctpfei) static void channel_swdemux_tsklet(unsigned long data) { struct channel_info *channel =3D (struct channel_info *)data; - struct c8sectpfei *fei =3D channel->fei; + struct c8sectpfei *fei; unsigned long wp, rp; int pos, num_packets, n, size; u8 *buf; @@ -91,6 +91,8 @@ static void channel_swdemux_tsklet(unsigned long data) if (unlikely(!channel || !channel->irec)) return; =20 + fei =3D channel->fei; + wp =3D readl(channel->irec + DMA_PRDS_BUSWP_TP(0)); rp =3D readl(channel->irec + DMA_PRDS_BUSRP_TP(0)); =20 --=20 2.14.1