* [2.6 patch] dvb_frontend_ioctl(): fix check-after-use
@ 2007-07-30 22:28 Adrian Bunk
2007-08-01 3:52 ` Manu Abraham
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2007-07-30 22:28 UTC (permalink / raw)
To: v4l-dvb-maintainer; +Cc: linux-kernel
The Coverity checker spotted that we have already oops'ed if "fe" was NULL.
Since "fe" being NULL seems impossible at this point this patch removes
the NULL check.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
--- linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c.old 2007-07-29 21:41:56.000000000 +0200
+++ linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c 2007-07-29 21:42:16.000000000 +0200
@@ -706,11 +706,11 @@ static int dvb_frontend_ioctl(struct ino
struct dvb_frontend_private *fepriv = fe->frontend_priv;
int err = -EOPNOTSUPP;
dprintk ("%s\n", __FUNCTION__);
- if (!fe || fepriv->exit)
+ if (fepriv->exit)
return -ENODEV;
if ((file->f_flags & O_ACCMODE) == O_RDONLY &&
(_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT ||
cmd == FE_DISEQC_RECV_SLAVE_REPLY))
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] dvb_frontend_ioctl(): fix check-after-use
2007-07-30 22:28 [2.6 patch] dvb_frontend_ioctl(): fix check-after-use Adrian Bunk
@ 2007-08-01 3:52 ` Manu Abraham
2007-08-10 17:47 ` [v4l-dvb-maintainer] " Markus Rechberger
0 siblings, 1 reply; 5+ messages in thread
From: Manu Abraham @ 2007-08-01 3:52 UTC (permalink / raw)
To: Adrian Bunk; +Cc: v4l-dvb-maintainer, linux-kernel
On 7/31/07, Adrian Bunk <bunk@stusta.de> wrote:
> The Coverity checker spotted that we have already oops'ed if "fe" was NULL.
>
> Since "fe" being NULL seems impossible at this point this patch removes
> the NULL check.
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
> ---
> --- linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c.old 2007-07-29 21:41:56.000000000 +0200
> +++ linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c 2007-07-29 21:42:16.000000000 +0200
> @@ -706,11 +706,11 @@ static int dvb_frontend_ioctl(struct ino
> struct dvb_frontend_private *fepriv = fe->frontend_priv;
> int err = -EOPNOTSUPP;
>
> dprintk ("%s\n", __FUNCTION__);
>
> - if (!fe || fepriv->exit)
> + if (fepriv->exit)
> return -ENODEV;
>
> if ((file->f_flags & O_ACCMODE) == O_RDONLY &&
> (_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT ||
> cmd == FE_DISEQC_RECV_SLAVE_REPLY))
>
> -
Acked-by: Manu Abraham <manu@linuxtv.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [v4l-dvb-maintainer] [2.6 patch] dvb_frontend_ioctl(): fix check-after-use
2007-08-01 3:52 ` Manu Abraham
@ 2007-08-10 17:47 ` Markus Rechberger
2007-08-10 23:19 ` Trent Piepho
0 siblings, 1 reply; 5+ messages in thread
From: Markus Rechberger @ 2007-08-10 17:47 UTC (permalink / raw)
To: Manu Abraham; +Cc: Adrian Bunk, v4l-dvb-maintainer, linux-kernel
On 8/1/07, Manu Abraham <abraham.manu@gmail.com> wrote:
> On 7/31/07, Adrian Bunk <bunk@stusta.de> wrote:
> > The Coverity checker spotted that we have already oops'ed if "fe" was
> NULL.
> >
> > Since "fe" being NULL seems impossible at this point this patch removes
> > the NULL check.
> >
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> >
> > ---
> > --- linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c.old
> 2007-07-29 21:41:56.000000000 +0200
> > +++ linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c
> 2007-07-29 21:42:16.000000000 +0200
> > @@ -706,11 +706,11 @@ static int dvb_frontend_ioctl(struct ino
> > struct dvb_frontend_private *fepriv = fe->frontend_priv;
> > int err = -EOPNOTSUPP;
> >
> > dprintk ("%s\n", __FUNCTION__);
> >
> > - if (!fe || fepriv->exit)
> > + if (fepriv->exit)
> > return -ENODEV;
> >
> > if ((file->f_flags & O_ACCMODE) == O_RDONLY &&
> > (_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT ||
> > cmd == FE_DISEQC_RECV_SLAVE_REPLY))
> >
> > -
>
> Acked-by: Manu Abraham <manu@linuxtv.org>
>
This issue has been known for a while including some other problems at
that part.
http://article.gmane.org/gmane.linux.drivers.dvb/35351/match=patch+dvb_net+hotplugging+support
this includes a link where this and more got discussed in May.
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [v4l-dvb-maintainer] [2.6 patch] dvb_frontend_ioctl(): fix check-after-use
2007-08-10 17:47 ` [v4l-dvb-maintainer] " Markus Rechberger
@ 2007-08-10 23:19 ` Trent Piepho
2007-08-11 11:13 ` Markus Rechberger
0 siblings, 1 reply; 5+ messages in thread
From: Trent Piepho @ 2007-08-10 23:19 UTC (permalink / raw)
To: Markus Rechberger
Cc: Manu Abraham, v4l-dvb-maintainer, linux-kernel, Adrian Bunk
On Fri, 10 Aug 2007, Markus Rechberger wrote:
> On 8/1/07, Manu Abraham <abraham.manu@gmail.com> wrote:
> > On 7/31/07, Adrian Bunk <bunk@stusta.de> wrote:
> > > The Coverity checker spotted that we have already oops'ed if "fe" was
> > NULL.
> > >
> > > --- linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c.old
> > > +++ linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c
> > > @@ -706,11 +706,11 @@ static int dvb_frontend_ioctl(struct ino
> > > - if (!fe || fepriv->exit)
> > > + if (fepriv->exit)
> > > return -ENODEV;
>
> This issue has been known for a while including some other problems at
> that part.
>
> http://article.gmane.org/gmane.linux.drivers.dvb/35351/match=patch+dvb_net+hotplugging+support
>
> this includes a link where this and more got discussed in May.
For dvb_net_close, I like the patch I already posted better. To fix the
check-after-use, it's not "use" part that's the problem, it's the "check" part
that isn't necessary.
I traced the dvb-net code, http://article.gmane.org/gmane.linux.kernel/543689,
and I'm sure that dvbdev can't be NULL.
My patch also deletes a few pieces of duplicated code by calling
dvb_generic_release().
The only problem is that practically no one uses dvb-net, so it's very hard to
test these patches.
In all the dvb code, were is the locking for device open and release? I don't
see it. What is preventing two threads from trying to open and/or close the
same dvb device at the same time?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [v4l-dvb-maintainer] [2.6 patch] dvb_frontend_ioctl(): fix check-after-use
2007-08-10 23:19 ` Trent Piepho
@ 2007-08-11 11:13 ` Markus Rechberger
0 siblings, 0 replies; 5+ messages in thread
From: Markus Rechberger @ 2007-08-11 11:13 UTC (permalink / raw)
To: Trent Piepho; +Cc: Manu Abraham, v4l-dvb-maintainer, linux-kernel, Adrian Bunk
On 8/11/07, Trent Piepho <xyzzy@speakeasy.org> wrote:
> On Fri, 10 Aug 2007, Markus Rechberger wrote:
> > On 8/1/07, Manu Abraham <abraham.manu@gmail.com> wrote:
> > > On 7/31/07, Adrian Bunk <bunk@stusta.de> wrote:
> > > > The Coverity checker spotted that we have already oops'ed if "fe" was
> > > NULL.
> > > >
> > > > --- linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c.old
> > > > +++ linux-2.6.23-rc1-mm1/drivers/media/dvb/dvb-core/dvb_frontend.c
> > > > @@ -706,11 +706,11 @@ static int dvb_frontend_ioctl(struct ino
> > > > - if (!fe || fepriv->exit)
> > > > + if (fepriv->exit)
> > > > return -ENODEV;
> >
> > This issue has been known for a while including some other problems at
> > that part.
> >
> >
> http://article.gmane.org/gmane.linux.drivers.dvb/35351/match=patch+dvb_net+hotplugging+support
> >
> > this includes a link where this and more got discussed in May.
>
> For dvb_net_close, I like the patch I already posted better. To fix the
> check-after-use, it's not "use" part that's the problem, it's the "check"
> part
> that isn't necessary.
>
> I traced the dvb-net code,
> http://article.gmane.org/gmane.linux.kernel/543689,
> and I'm sure that dvbdev can't be NULL.
>
> My patch also deletes a few pieces of duplicated code by calling
> dvb_generic_release().
>
> The only problem is that practically no one uses dvb-net, so it's very hard
> to
> test these patches.
>
I didn't see this patch, it would be fine if it would get applied.
> In all the dvb code, were is the locking for device open and release? I
> don't
> see it. What is preventing two threads from trying to open and/or close the
> same dvb device at the same time?
>
Haven't looked at that yet, since I moreover work to get the em28xx
driver included now.
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-11 11:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-30 22:28 [2.6 patch] dvb_frontend_ioctl(): fix check-after-use Adrian Bunk
2007-08-01 3:52 ` Manu Abraham
2007-08-10 17:47 ` [v4l-dvb-maintainer] " Markus Rechberger
2007-08-10 23:19 ` Trent Piepho
2007-08-11 11:13 ` Markus Rechberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox