From patchwork Sat Sep 22 16:51:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 1494441 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 23ACA3FC71 for ; Sat, 22 Sep 2012 16:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661Ab2IVQwq (ORCPT ); Sat, 22 Sep 2012 12:52:46 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:51021 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346Ab2IVQwk (ORCPT ); Sat, 22 Sep 2012 12:52:40 -0400 Received: from dyn3-82-128-186-237.psoas.suomi.net ([82.128.186.237] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TFSwX-0006RH-L1; Sat, 22 Sep 2012 19:52:37 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 2/5] dvb_usb_v2: fix error handling for .tuner_attach() Date: Sat, 22 Sep 2012 19:51:37 +0300 Message-Id: <1348332700-10267-2-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348332700-10267-1-git-send-email-crope@iki.fi> References: <1348332700-10267-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.186.237 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org fe was not set NULL after it was destroyed in tuner attach fail error case. Due to that it was destroyed again and Kernel oopsed. Reported-by: Oliver Schinagl Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index f990159..9859d2a 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -612,8 +612,10 @@ err_dvb_unregister_frontend: err_dvb_frontend_detach: for (i = MAX_NO_OF_FE_PER_ADAP - 1; i >= 0; i--) { - if (adap->fe[i]) + if (adap->fe[i]) { dvb_frontend_detach(adap->fe[i]); + adap->fe[i] = NULL; + } } err: