All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: VDR User <user.vdr@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	LMML <linux-media@vger.kernel.org>
Subject: Re: Question about 2 gp8psk patches I noticed, and possible bug.
Date: Fri, 11 Nov 2016 10:49:03 -0200	[thread overview]
Message-ID: <20161111104903.607428e5@vela.lan> (raw)
In-Reply-To: <CAA7C2qiPZnqpJ8MYkQ3wGhnmHzK25kLEP_Sm-1UOu8aECzkOGA@mail.gmail.com>

Em Thu, 10 Nov 2016 07:01:44 -0800
VDR User <user.vdr@gmail.com> escreveu:

> > commit 0c979a12309af49894bb1dc60e747c3cd53fa888
> > Author: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> > 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 <mchehab@s-opensource.com>
> >
> > 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 <mchehab@s-opensource.com>

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;
 }
 





Cheers,
Mauro

  reply	other threads:[~2016-11-11 12:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAA7C2qjXSkmmCB=zc7Y-Btpwzm_B=_ok0t6qMRuCy+gfrEhcMw@mail.gmail.com>
2016-11-08 17:55 ` Question about 2 gp8psk patches I noticed, and possible bug Mauro Carvalho Chehab
2016-11-09  6:00   ` VDR User
2016-11-09  9:33     ` Mauro Carvalho Chehab
2016-11-09 15:37       ` VDR User
2016-11-09 15:49         ` VDR User
2016-11-09 17:35           ` Mauro Carvalho Chehab
2016-11-10  1:03             ` VDR User
2016-11-10  8:07               ` Mauro Carvalho Chehab
2016-11-10 15:01                 ` VDR User
2016-11-11 12:49                   ` Mauro Carvalho Chehab [this message]
2016-11-11 15:33                     ` VDR User
2016-11-11 21:53                       ` Mauro Carvalho Chehab
2016-11-11 22:10                         ` Mauro Carvalho Chehab
2016-11-12  4:45                           ` VDR User
2016-11-12  4:52                             ` VDR User
2016-11-12  5:21                               ` VDR User
2016-11-12  8:14                             ` Mauro Carvalho Chehab
2016-11-12 10:20                               ` VDR User
2016-11-12 13:59                                 ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161111104903.607428e5@vela.lan \
    --to=mchehab@infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=user.vdr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.