Commit 2342d65
btrfs: fix warning on PTR_ERR() against NULL device at btrfs_control_ioctl()
Smatch complains about calling PTR_ERR() against a NULL pointer:
fs/btrfs/super.c:2272 btrfs_control_ioctl() warn: passing zero to 'PTR_ERR'
Fix this by calling PTR_ERR() against the device pointer only if it
contains an error.
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 80b3695 commit 2342d65
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2254 | 2254 | | |
2255 | 2255 | | |
2256 | 2256 | | |
2257 | | - | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
2258 | 2261 | | |
2259 | 2262 | | |
2260 | 2263 | | |
| |||
0 commit comments