cxl/core/port: fix NULL but dereferenced coccicheck error
PATCH 1/1 cxl/core/port: fix NULL but dereferenced coccicheck error
Fix the following coccicheck warning:
./drivers/cxl/core/port.c:913:21-24: ERROR: port is NULL but dereferenced.
Signed-off-by Wan Jiabing <[email protected]>
--- drivers/cxl/core/port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/cxl/core/port.c +4 -1
@@ -909,7 +909,10 @@ static void cxl_detach_ep(void *data)break ; port =find_cxl_port (dport_dev); -if (!port ||is_cxl_root (port)) { +if (!port) +continue ; + +if (is_cxl_root (port)) {put_device (&port->dev);continue ; }
Signature · 1 line
2.35.1
Dan Williams
AppliedQuoted 5 lines · Wan Jiabing
Fix the following coccicheck warning:
./drivers/cxl/core/port.c:913:21-24: ERROR: port is NULL but dereferenced.Signed-off-by Wan Jiabing <[email protected]>
Thanks, applied.