Skip to content

Commit

Permalink
media: staging: atomisp: don't access a NULL var
Browse files Browse the repository at this point in the history
Get rid of those warnings:
	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:446 gmin_v1p2_ctrl() error: we previously assumed 'gs' could be null (see line 444)
	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:480 gmin_v1p8_ctrl() error: we previously assumed 'gs' could be null (see line 478)
	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:516 gmin_v2p8_ctrl() error: we previously assumed 'gs' could be null (see line 514)

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
  • Loading branch information
Mauro Carvalho Chehab committed Apr 4, 2018
1 parent 6dfc6a3 commit 8b1a246
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static int gmin_v1p2_ctrl(struct v4l2_subdev *subdev, int on)
{
struct gmin_subdev *gs = find_gmin_subdev(subdev);

if (gs && gs->v1p2_on == on)
if (!gs || gs->v1p2_on == on)
return 0;
gs->v1p2_on = on;

Expand Down Expand Up @@ -475,7 +475,7 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
}
}

if (gs && gs->v1p8_on == on)
if (!gs || gs->v1p8_on == on)
return 0;
gs->v1p8_on = on;

Expand Down Expand Up @@ -511,7 +511,7 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
}
}

if (gs && gs->v2p8_on == on)
if (!gs || gs->v2p8_on == on)
return 0;
gs->v2p8_on = on;

Expand Down

0 comments on commit 8b1a246

Please sign in to comment.