mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
coresight-tmc: Fix false positive -Wfortify-source
The size is checked just above.
../drivers/hwtracing/coresight/coresight-tmc.c:423:26: warning: 'sscanf' may overflow; destination buffer in argument 3 has size 10, but the corresponding specifier may require size 11 [-Wfortify-source]
423 | if (sscanf(buf, "%10s", str) != 1)
| ^
../drivers/hwtracing/coresight/coresight-tmc.c:464:26: warning: 'sscanf' may overflow; destination buffer in argument 3 has size 10, but the corresponding specifier may require size 11 [-Wfortify-source]
464 | if (sscanf(buf, "%10s", str) != 1)
| ^
2 warnings generated.
Change-Id: I5db199a85ba0c7dfc15fae5d62c9c4d8c550d3e7
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
This commit is contained in:
parent
4e8fdc63e9
commit
4f5bf3d147
1 changed files with 2 additions and 2 deletions
|
|
@ -420,7 +420,7 @@ static ssize_t out_mode_store(struct device *dev,
|
|||
|
||||
if (strlen(buf) >= 10)
|
||||
return -EINVAL;
|
||||
if (sscanf(buf, "%10s", str) != 1)
|
||||
if (sscanf(buf, "%s", str) != 1)
|
||||
return -EINVAL;
|
||||
ret = tmc_etr_switch_mode(drvdata, str);
|
||||
return ret ? ret : size;
|
||||
|
|
@ -461,7 +461,7 @@ static ssize_t pcie_path_store(struct device *dev,
|
|||
|
||||
if (strlen(buf) >= 10)
|
||||
return -EINVAL;
|
||||
if (sscanf(buf, "%10s", str) != 1)
|
||||
if (sscanf(buf, "%s", str) != 1)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&drvdata->mem_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue