[PATCH] tty: serial: samsung_tty: Check null pointer after calling of_match_node

Krzysztof Kozlowski krzysztof.kozlowski at canonical.com
Tue Jan 11 00:24:37 PST 2022


On 11/01/2022 09:16, Jiasheng Jiang wrote:
> If there is no suitable node, of_match_node() will return NULL pointer.

NAK.

This is not possible. All drivers have such pattern and it was
discouraged to add empty/dead NULL checks.

If you think returning NULL is possible, please explain/document it.

> Therefore it should be better to check it in order to avoid the
> dereference of NULL pointer.
> And the only caller s3c24xx_serial_probe() has already checked the
> return value of the s3c24xx_get_driver_data().
> So the new check can be dealed with.
> 



Best regards,
Krzysztof



More information about the linux-arm-kernel mailing list