On 11/11/2022 13:24, Yang Yingliang wrote:
In sas_port_add(), the return value of transport_add_device() is not checked. As a result, it causes null-ptr-deref while removing device, because transport_remove_device() is called to remove the device that was not added.
This makes it sound like we have the null-ptr-deref always, which would not be the case.
You need to make it clear that we don't check for an error in the add and we may later go on to try to remove a device which was never successfully added, causing the null-ptr-deref.
Apart from comment, above: Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>