Re: [PATCH v4] cxl: Fix possible null pointer dereference in read_handle()

From: Greg KH
Date: Mon Jul 15 2024 - 01:12:57 EST


On Mon, Jul 15, 2024 at 10:54:42AM +0800, Ma Ke wrote:
> In read_handle(), of_get_address() may return NULL if getting address and
> size of the node failed. When of_read_number() uses prop to handle
> conversions between different byte orders, it could lead to a null pointer
> dereference. Add NULL check to fix potential issue.
>
> Found by static analysis.

You need to describe the tool that found this. And how did you test
that your fix is correct?

thanks,

greg k-h