diff options
| author | Cengiz Can <[email protected]> | 2020-08-02 00:01:02 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2020-09-03 11:01:18 +0200 |
| commit | 9b734bb9e7c689217e3025d0a512bf06e3b6ecd4 (patch) | |
| tree | 698c43e8e8fee5135c7131c197f72fdaf48d56da /tools/perf/scripts/python | |
| parent | 8d1fdaa50c0adc131f4165d0da461a8a0d2fa46b (diff) | |
media: atomisp: move null check to earlier point
`find_gmin_subdev()` that returns a pointer to `struct
gmin_subdev` can return NULL.
In `gmin_v2p8_ctrl()` there's a call to this function but the
possibility of a NULL was not checked before its being dereferenced,
i.e.:
/* Acquired here --------v */
struct gmin_subdev *gs = find_gmin_subdev(subdev);
/* v------Dereferenced here */
if (gs->v2p8_gpio >= 0) {
...
}
With this change we're null checking `find_gmin_subdev()` result
and we return an error if that's the case. We also WARN()
for the sake of debugging.
Signed-off-by: Cengiz Can <[email protected]>
Reported-by: Coverity Static Analyzer CID 1465536
Suggested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions