Commit 97886cb
committed
tree: do not try to strdup NULL pointer
blktests nvme/003 using the loop transport fails because nvme_ctrl_alloc
tries to strdup NULL pointers (address or sysfs_dir).
Introduce a 'safe' strdup version and start this version.
Reported-by: Tomáš Bžatek <[email protected]>
Reported-by: Yi Zhang <[email protected]>
Fixes: e642498 ("tree: free ctrl attributes when (re)configure ctrl")
Signed-off-by: Daniel Wagner <[email protected]>1 parent 6e6154a commit 97886cb
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
338 | 345 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2073 | 2073 | | |
2074 | 2074 | | |
2075 | 2075 | | |
2076 | | - | |
2077 | | - | |
| 2076 | + | |
| 2077 | + | |
2078 | 2078 | | |
2079 | 2079 | | |
2080 | 2080 | | |
| |||
2230 | 2230 | | |
2231 | 2231 | | |
2232 | 2232 | | |
2233 | | - | |
| 2233 | + | |
2234 | 2234 | | |
2235 | 2235 | | |
2236 | 2236 | | |
| |||
0 commit comments