diff options
author | Suzuki K Poulose <[email protected]> | 2019-06-21 11:52:04 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2019-07-03 21:16:36 +0200 |
commit | 020601622323d02e09cebe05e7976b3d4b44e05d (patch) | |
tree | 87131bddf35a628daf522374f4a95c92935551b4 /tools/perf/scripts/python/net_dropmonitor.py | |
parent | 0530ef6b41e80c5cc979e0e50682302161edb6b7 (diff) |
coresight: etm3x: Smatch: Fix potential NULL pointer dereference
Based on the following report from Smatch tool, make sure we have a
valid drvdata before we dereference it to find the real dev.
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
Cc: Mathieu Poirier <[email protected]>
Cc: Dan Carpenter <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions