]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cxl/port: Fix NULL pointer access in devm_cxl_add_port()
authorRobert Richter <rrichter@amd.com>
Fri, 19 May 2023 21:54:35 +0000 (23:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:23 +0000 (17:07 +0000)
commit9e1e0887ea21e9fef0f1a2a3ad715f9a3aa9535d
tree0782b0386c377fa04786368e3461ba5d51ac2af7
parentc88cfbb18a5e498f405836b11f1dd31c54d7a7de
cxl/port: Fix NULL pointer access in devm_cxl_add_port()

commit a70fc4ed20a6118837b0aecbbf789074935f473b upstream.

In devm_cxl_add_port() the port creation may fail and its associated
pointer does not contain a valid address. During error message
generation this invalid port address is used. Fix that wrong address
access.

Fixes: f3cd264c4ec1 ("cxl: Unify debug messages when calling devm_cxl_add_port()")
Signed-off-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230519215436.3394532-1-rrichter@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cxl/core/port.c