Skip to content

Commit

Permalink
coresight: etb10: Fix check for bogus buffer depth
Browse files Browse the repository at this point in the history
We attempt to sanity check the buffer depth reported by the hardware by
making sure it is not less than zero however this check will never be true
since the buffer depth is stored in an unsigned integer. Instead change
the check to look for the top bit being set which was the intention.

Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
broonie authored and gregkh committed May 18, 2015
1 parent cc54544 commit f5da7cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-etb10.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
drvdata->buffer_depth = etb_get_buffer_depth(drvdata);
clk_disable_unprepare(drvdata->clk);

if (drvdata->buffer_depth < 0)
if (drvdata->buffer_depth & 0x80000000)
return -EINVAL;

drvdata->buf = devm_kzalloc(dev,
Expand Down

0 comments on commit f5da7cb

Please sign in to comment.