Received: by 10.223.164.202 with SMTP id h10csp3845014wrb; Mon, 20 Nov 2017 06:02:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMbtaze6AL3vJ1zi1QUCuZTvX/8p7/anV3EUsInjFOYBgcBS/Wvj77wE7tddxJrno7H8wxjk X-Received: by 10.101.100.76 with SMTP id s12mr13747972pgv.173.1511186526263; Mon, 20 Nov 2017 06:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511186526; cv=none; d=google.com; s=arc-20160816; b=xe7KE25hj0sZTietw0nYhNaZtaqBmzhmcUHB4fY/SQJ85t5TyxqxHJw7MAZe4fMlWo Wb0L/uyK8NOJsv08vUCCsPLhUuTe3xLja70zpnsrOJeMPV2/GmpLlteCS+de9FjjF4eu b+QB7RlcuUv5xae3wFx6okRyB/HtnegUfUICe4TlNip2n42rW3o1hGXx9cRGCd3VoF0x elNPUlmKvzBMfobGmCPAIHfFUsHLOKtJKdiAtfhArolPbjGdUVtzoPgTXIuQXTHIOSOK Y7h1b21KwfvzjE0h1q1xyg5LJxO7npDxgpFXokUrbpWDiasshyVH/K5QHe9+pqWCXOcO 6l2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=653tltdKwGvaOfqaj5UxTGdlEybs2JzLPdWkbWwDZ98=; b=W98AdyLt6LOJqZOBFPQrNl0B8BYjJn9dH3pr5oAmGrNTorpq42auJwNzafS2BBP53b VuRfZA4lYO6raNF5xGHbRiutGU4QJeO6nUNy1dMh6/AmVCXDviMZ+TD6Hkr4XMl/+nyZ qFJXHrBNPtDM7uy9Y1e0reer55GP524GXNm9Y2fOM+psnib6D2IQkWqvTrEuzGG1BUI7 hDGjenHuR3ekHsXMgg17pLJ9L2DTtta4CJU1WdtcaB32IhHfeS3jPuKW2NS7HewtefZ3 7mZHXLgaoudJGo65eqGHNnUdvEC+d24P7n7r9Up81IGF4grG1IpZ+1fQACOYyIXNtd96 rHjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si9157419pff.45.2017.11.20.06.01.56; Mon, 20 Nov 2017 06:02:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbdKTOBA (ORCPT + 66 others); Mon, 20 Nov 2017 09:01:00 -0500 Received: from gateway34.websitewelcome.com ([192.185.150.114]:18761 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751100AbdKTOA7 (ORCPT ); Mon, 20 Nov 2017 09:00:59 -0500 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 5110543403 for ; Mon, 20 Nov 2017 08:00:58 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id Gmd8e7Q70pOTvGmd8eoOtR; Mon, 20 Nov 2017 08:00:58 -0600 Received: from [189.175.119.135] (port=51554 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1eGmd7-002xvk-Qm; Mon, 20 Nov 2017 08:00:57 -0600 Date: Mon, 20 Nov 2017 08:00:55 -0600 From: "Gustavo A. R. Silva" To: Patrice Chotard , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] c8sectpfe: fix potential NULL pointer dereference in c8sectpfe_timer_interrupt Message-ID: <20171120140055.GA728@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.119.135 X-Source-L: No X-Exim-ID: 1eGmd7-002xvk-Qm X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.175.119.135]:51554 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org _channel_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference 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 --- 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/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 59280ac..23d0ced 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 ac8sectpfei) static void channel_swdemux_tsklet(unsigned long data) { struct channel_info *channel = (struct channel_info *)data; - struct c8sectpfei *fei = 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; + fei = channel->fei; + wp = readl(channel->irec + DMA_PRDS_BUSWP_TP(0)); rp = readl(channel->irec + DMA_PRDS_BUSRP_TP(0)); -- 2.7.4 From 1585947897543497895@xxx Tue Dec 05 12:42:57 +0000 2017 X-GM-THRID: 1585947897543497895 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread