From patchwork Mon Nov 5 15:51:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Scheel X-Patchwork-Id: 1699261 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0A31CDF2AB for ; Mon, 5 Nov 2012 15:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072Ab2KEPuM (ORCPT ); Mon, 5 Nov 2012 10:50:12 -0500 Received: from smtp1.work.de ([212.12.40.178]:38229 "EHLO smtp.work.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751991Ab2KEPuI (ORCPT ); Mon, 5 Nov 2012 10:50:08 -0500 Received: from [91.60.13.112] (helo=avionic-0108.adnet.avionic-design.de) by smtp.work.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TVOwA-0004jJ-F9; Mon, 05 Nov 2012 16:50:06 +0100 From: Julian Scheel To: linux-media@vger.kernel.org Cc: Julian Scheel Subject: [PATCH] tm6000-dvb: Fix module unload. Date: Mon, 5 Nov 2012 16:51:05 +0100 Message-Id: <1352130665-10795-1-git-send-email-julian@jusst.de> X-Mailer: git-send-email 1.8.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org dvb_unregister_frontend has to be called before detach. Otherwise the unregister call will segfault. This made tm6000-dvb module unload unusable. Signed-off-by: Julian Scheel --- drivers/media/usb/tm6000/tm6000-dvb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/tm6000/tm6000-dvb.c b/drivers/media/usb/tm6000/tm6000-dvb.c index e1f3f66..9fc1e94 100644 --- a/drivers/media/usb/tm6000/tm6000-dvb.c +++ b/drivers/media/usb/tm6000/tm6000-dvb.c @@ -360,8 +360,8 @@ dvb_dmx_err: dvb_dmx_release(&dvb->demux); frontend_err: if (dvb->frontend) { - dvb_frontend_detach(dvb->frontend); dvb_unregister_frontend(dvb->frontend); + dvb_frontend_detach(dvb->frontend); } adapter_err: dvb_unregister_adapter(&dvb->adapter); @@ -384,8 +384,8 @@ static void unregister_dvb(struct tm6000_core *dev) /* mutex_lock(&tm6000_driver.open_close_mutex); */ if (dvb->frontend) { - dvb_frontend_detach(dvb->frontend); dvb_unregister_frontend(dvb->frontend); + dvb_frontend_detach(dvb->frontend); } dvb_dmxdev_release(&dvb->dmxdev);