From patchwork Fri Nov 11 12:49:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9422979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA4D260484 for ; Fri, 11 Nov 2016 12:49:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D9C629ADE for ; Fri, 11 Nov 2016 12:49:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9132529AE1; Fri, 11 Nov 2016 12:49:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE0FA29ADE for ; Fri, 11 Nov 2016 12:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756555AbcKKMtp (ORCPT ); Fri, 11 Nov 2016 07:49:45 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:38148 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756324AbcKKMto (ORCPT ); Fri, 11 Nov 2016 07:49:44 -0500 Received: from [177.79.7.77] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1c5BH2-0008Lt-Nd; Fri, 11 Nov 2016 12:49:43 +0000 Received: from localhost ([127.0.0.1] helo=vela.lan) by smtp.w2.samsung.com with esmtp (Exim 4.87) (envelope-from ) id 1c5BGx-0000JU-C0; Fri, 11 Nov 2016 10:49:35 -0200 Date: Fri, 11 Nov 2016 10:49:03 -0200 From: Mauro Carvalho Chehab To: VDR User Cc: Mauro Carvalho Chehab , LMML Subject: Re: Question about 2 gp8psk patches I noticed, and possible bug. Message-ID: <20161111104903.607428e5@vela.lan> In-Reply-To: References: <20161108155520.224229d5@vento.lan> <20161109073331.204b53c4@vento.lan> <20161109153521.232b0956@vento.lan> <20161110060717.221e8d88@vento.lan> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Em Thu, 10 Nov 2016 07:01:44 -0800 VDR User escreveu: > > commit 0c979a12309af49894bb1dc60e747c3cd53fa888 > > Author: Mauro Carvalho Chehab > > Date: Wed Nov 9 15:33:17 2016 -0200 > > > > [media] gp8psk: Fix DVB frontend attach > > > > it should be calling module_get() at attach, as otherwise > > module_put() will crash. > > > > Signed-off-by: Mauro Carvalho Chehab > > > > diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c > > index cede0d8b0f8a..24eb6c6c8e24 100644 > > --- a/drivers/media/usb/dvb-usb/gp8psk.c > > +++ b/drivers/media/usb/dvb-usb/gp8psk.c > > @@ -250,7 +250,7 @@ static int gp8psk_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) > > > > static int gp8psk_frontend_attach(struct dvb_usb_adapter *adap) > > { > > - adap->fe_adap[0].fe = gp8psk_fe_attach(adap->dev); > > + adap->fe_adap[0].fe = dvb_attach(gp8psk_fe_attach, adap->dev); > > return 0; > > } > > This gives: > > [119150.498863] DVB: Unable to find symbol gp8psk_fe_attach() > [119150.498928] dvb-usb: no frontend was attached by 'Genpix > SkyWalker-2 DVB-S receiver' Hmm... dvb_attach() assumes that the symbol is exported. Please try this patch. If it fixes the bug, I'll likely do something else, to avoid the need of EXPORT_SYMBOL. [PATCH] [media] gp8psk: Fix DVB frontend attach it should be calling module_get() at attach, as otherwise module_put() will crash. Signed-off-by: Mauro Carvalho Chehab Cheers, Mauro --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/usb/dvb-usb/gp8psk-fe.c b/drivers/media/usb/dvb-usb/gp8psk-fe.c index db6eb79cde07..ab7c6093436b 100644 --- a/drivers/media/usb/dvb-usb/gp8psk-fe.c +++ b/drivers/media/usb/dvb-usb/gp8psk-fe.c @@ -326,6 +326,7 @@ struct dvb_frontend * gp8psk_fe_attach(struct dvb_usb_device *d) success: return &s->fe; } +EXPORT_SYMBOL_GPL(gp8psk_fe_attach); static struct dvb_frontend_ops gp8psk_fe_ops = { diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c index 2829e3082d15..c3762c50e93b 100644 --- a/drivers/media/usb/dvb-usb/gp8psk.c +++ b/drivers/media/usb/dvb-usb/gp8psk.c @@ -250,7 +250,7 @@ static int gp8psk_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) static int gp8psk_frontend_attach(struct dvb_usb_adapter *adap) { - adap->fe_adap[0].fe = gp8psk_fe_attach(adap->dev); + adap->fe_adap[0].fe = dvb_attach(gp8psk_fe_attach, adap->dev); return 0; }