public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: stoth@linuxtv.org
Cc: mjpeg-users@lists.sourceforge.net, linux-media@vger.kernel.org
Subject: potential null deref in mpeg_open()
Date: Sun, 19 Jul 2009 14:47:04 +0300 (EAT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0907171457580.12306@bicker> (raw)

Hello,

I am testing a source checker (http://repo.or.cz/w/smatch.git) and it 
found a bug in in mpeg_open() from drivers/media/video/cx23885/cx23885-417.c

"dev" is null on line 1554, so on line 1558 dprintk() will cause a 
kernel oops if it is in debug mode.

drivers/media/video/cx23885/cx23885-417.c
  1554          struct cx23885_dev *h, *dev = NULL;
  1555          struct list_head *list;
  1556          struct cx23885_fh *fh;
  1557  
  1558          dprintk(2, "%s()\n", __func__);

Here is how dprintk() is defined earlier.

drivers/media/video/cx23885/cx23885-417.c
    59  #define dprintk(level, fmt, arg...)\
    60          do { if (v4l_debug >= level) \
    61                  printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg);\
    62          } while (0)

regards,
dan carpenter

             reply	other threads:[~2009-07-19 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19 11:47 Dan Carpenter [this message]
2009-07-20 16:38 ` potential null deref in mpeg_open() Steven Toth

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=alpine.DEB.2.00.0907171457580.12306@bicker \
    --to=error27@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mjpeg-users@lists.sourceforge.net \
    --cc=stoth@linuxtv.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox