coresight: etm: Clean up device specific data
Hello Suzuki K Poulose,
This is a semi-automatic email about new static checker warnings.
The patch 21d26b905c05: "coresight: etm: Clean up device specific data" from May 22, 2019, leads to the following Smatch complaint:
./drivers/hwtracing/coresight/coresight-etm3x.c:460 etm_get_trace_id()
warn: variable dereferenced before check 'drvdata' (see line 458)
./drivers/hwtracing/coresight/coresight-etm3x.c
457 int trace_id = -1;
458 struct device *etm_dev = drvdata->csdev->dev.parent;
^^^^^^^^^New dereference
459
460 if (!drvdata)
^^^^^^^^
Checked too late. Delete the check?
461 goto out;
462
regards,
dan carpenter
Hi Dan
Quoted 16 lines · Dan Carpenter
Hello Suzuki K Poulose,
This is a semi-automatic email about new static checker warnings.
The patch
21d26b905c05: "coresight: etm: Clean up device specific data" from May 22, 2019, leads to the following Smatch complaint:
./drivers/hwtracing/coresight/coresight-etm3x.c:460etm_get_trace_id()
warn: variable dereferenced before check 'drvdata' (see line 458)
./drivers/hwtracing/coresight/coresight-etm3x.c457 int trace_id = -1; 458 struct device *etm_dev = drvdata->csdev->dev.parent; ^^^^^^^^^New dereference
Quoted 8 lines
459 460 if (!drvdata) ^^^^^^^^Checked too late. Delete the check?
461 goto out; 462
Thanks for the report. I have sent a patch to fix it.
Cheers
Suzuki
Thanks!
regards,
dan carpenter