Commit 52438c44 authored by Tom Rix's avatar Tom Rix Committed by Mauro Carvalho Chehab
Browse files

media: m5mols: Check function pointer in m5mols_sensor_power



clang static analysis reports this error

m5mols_core.c:767:4: warning: Called function pointer
  is null (null dereference) [core.CallAndMessage]
    info->set_power(&client->dev, 0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In other places, the set_power ptr is checked.
So add a check.

Fixes: bc125106 ("[media] Add support for M-5MOLS 8 Mega Pixel camera ISP")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e5b95c8f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -764,6 +764,7 @@ static int m5mols_sensor_power(struct m5mols_info *info, bool enable)

		ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies);
		if (ret) {
			if (info->set_power)
				info->set_power(&client->dev, 0);
			return ret;
		}