aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Djait <[email protected]>2024-12-12 13:40:04 +0000
committerMauro Carvalho Chehab <[email protected]>2024-12-19 11:50:15 +0000
commitf8d0343046655590723628cc0c240161995c135d (patch)
treef8c82053bf994231554361293b6796c145ac362d
parentmedia: ccs: Print a warning on CCS static data parser failure (diff)
downloadkernel-f8d0343046655590723628cc0c240161995c135d.tar.gz
kernel-f8d0343046655590723628cc0c240161995c135d.zip
media: ccs: Fail the probe on CCS static data parser failure
No need to continue probing when the CCS static data parser fails. Improve this by checking the return value and correctly exiting on failure. Signed-off-by: Mehdi Djait <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/i2c/ccs/ccs-core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index cb21df46bab1..2cdab2f3d9dc 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -3335,9 +3335,11 @@ static int ccs_probe(struct i2c_client *client)
rval = request_firmware(&fw, filename, &client->dev);
if (!rval) {
- ccs_data_parse(&sensor->sdata, fw->data, fw->size, &client->dev,
- true);
+ rval = ccs_data_parse(&sensor->sdata, fw->data, fw->size,
+ &client->dev, true);
release_firmware(fw);
+ if (rval)
+ goto out_power_off;
}
if (!(ccsdev->flags & CCS_DEVICE_FLAG_IS_SMIA) ||
@@ -3351,9 +3353,11 @@ static int ccs_probe(struct i2c_client *client)
rval = request_firmware(&fw, filename, &client->dev);
if (!rval) {
- ccs_data_parse(&sensor->mdata, fw->data, fw->size,
- &client->dev, true);
+ rval = ccs_data_parse(&sensor->mdata, fw->data,
+ fw->size, &client->dev, true);
release_firmware(fw);
+ if (rval)
+ goto out_release_sdata;
}
}