Skip to content

Commit

Permalink
staging: cx25821: avoid NULL pointer dereference
Browse files Browse the repository at this point in the history
Assign dev only if fh is not NULL.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alexander Beregalov authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 267c39c commit c424d46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/staging/cx25821/cx25821-audups11.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,11 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctl)
{
struct cx25821_fh *fh = priv;
struct cx25821_dev *dev = fh->dev;
struct cx25821_dev *dev;
int err;

if (fh) {
dev = fh->dev;
err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err)
return err;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/cx25821/cx25821-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,10 +963,11 @@ int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f)
int vidioc_s_frequency(struct file *file, void *priv, struct v4l2_frequency *f)
{
struct cx25821_fh *fh = priv;
struct cx25821_dev *dev = fh->dev;
struct cx25821_dev *dev;
int err;

if (fh) {
dev = fh->dev;
err = v4l2_prio_check(&dev->prio, &fh->prio);
if (0 != err)
return err;
Expand Down

0 comments on commit c424d46

Please sign in to comment.