staging: cx25821: avoid NULL pointer dereference
PATCH 1/1 staging: cx25821: avoid NULL pointer dereference
Assign dev only if fh is not NULL.
Signed-off-by Alexander Beregalov <[email protected]>
--- drivers/staging/cx25821/cx25821-audups11.c | 3 ++- drivers/staging/cx25821/cx25821-video.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/staging/cx25821/cx25821-audups11.c +2 -1
@@ -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;
drivers/staging/cx25821/cx25821-video.c +2 -1
@@ -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;
Signature · 1 line
1.6.6