diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2010-01-07 03:21:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 16:42:40 -0800 |
commit | c424d46fdc79df201707fe815aa8480751918025 (patch) | |
tree | c698e83ef6bf9eea31d095eafb3f561cd8392e3f /drivers/staging | |
parent | 267c39c918cd0c239148a281d51693f47d2e1e54 (diff) |
staging: cx25821: avoid NULL pointer dereference
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/cx25821/cx25821-audups11.c | 3 | ||||
-rw-r--r-- | drivers/staging/cx25821/cx25821-video.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/cx25821/cx25821-audups11.c b/drivers/staging/cx25821/cx25821-audups11.c index 89c8fe2997f..46c7f78bb97 100644 --- a/drivers/staging/cx25821/cx25821-audups11.c +++ b/drivers/staging/cx25821/cx25821-audups11.c @@ -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; diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c index 6e710ae067a..8cd3986d2e5 100644 --- a/drivers/staging/cx25821/cx25821-video.c +++ b/drivers/staging/cx25821/cx25821-video.c @@ -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; |