From patchwork Sat Jul 12 16:44:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 4539721 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 02C67C0515 for ; Sat, 12 Jul 2014 16:44:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 424E9201D5 for ; Sat, 12 Jul 2014 16:44:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62826201C7 for ; Sat, 12 Jul 2014 16:44:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752624AbaGLQol (ORCPT ); Sat, 12 Jul 2014 12:44:41 -0400 Received: from qmta10.emeryville.ca.mail.comcast.net ([76.96.30.17]:40633 "EHLO qmta10.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498AbaGLQoh (ORCPT ); Sat, 12 Jul 2014 12:44:37 -0400 Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta10.emeryville.ca.mail.comcast.net with comcast id RUj31o0051wfjNsAAUkdtY; Sat, 12 Jul 2014 16:44:37 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta23.emeryville.ca.mail.comcast.net with comcast id RUkc1o0010MU7Qa8jUkcFy; Sat, 12 Jul 2014 16:44:36 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 99ED1423FC; Sat, 12 Jul 2014 10:44:35 -0600 (MDT) From: Shuah Khan To: m.chehab@samsung.com, dheitmueller@kernellabs.com, olebowle@gmx.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] media: drx39xyj driver change to check fe exit flag from release Date: Sat, 12 Jul 2014 10:44:14 -0600 Message-Id: <079a2ff6ea88b8918b6144c8c054c6d4bb044347.1405179280.git.shuah.kh@samsung.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1405183477; bh=4RB5npt3VJYSsjxAxoknsGqFvhWTrK0WmrpBznsDoBE=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=SyPKt5IL/uvfiVmMIFZM4PYlF7m61w8VGCzHO2bsHsN+f5tyFiE1o0WMJSAPyp3s+ nTpRBa9UOBacrR1mOZVX/bc7hRzqPvLbpsASFaGSSmbXvO+pnbYfSHuLN75ymPJoJ6 iNjsbVV1TpE1EtE/eORluPww4CbhVHwrkCkBkMBQK0YT6Bhzw8koMUdENQHB2u4Jz6 GjqEopKNO659UYbDcl6jc60CUuU9zm0D4Nwp4rmXUqLlM3taULTwIQQfLvj6VebNHS r2N/poCRfYxolJz00+zPzytOKGoLxb+HtzZDEmOoHE+Ihkid4MH+hEWksUYXsUa9fG Q/uHHWZQvyCFA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change drx39xyj_release() to check fe exit flag to detect the device disconnect state and avoid accessing the device after it has been removed. Signed-off-by: Shuah Khan --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 9482954..54855a9 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -12238,7 +12238,9 @@ static void drx39xxj_release(struct dvb_frontend *fe) struct drx39xxj_state *state = fe->demodulator_priv; struct drx_demod_instance *demod = state->demod; - drxj_close(demod); + /* if device is removed don't access it */ + if (fe->exit != DVB_FE_DEVICE_REMOVED) + drxj_close(demod); kfree(demod->my_ext_attr); kfree(demod->my_common_attr);