Re: [PATCH] char: tpm: fix potential null pointer dereference

From: Gustavo A. R. Silva
Date: Tue May 30 2017 - 18:40:50 EST


Hi Jason,

Quoting Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>:

On Tue, May 30, 2017 at 05:05:20PM -0500, Gustavo A. R. Silva wrote:
NULL check at line 376: if (!chip) {, implies chip might be NULL.
Function dev_get_drvdata() dereference pointer chip.
Move pointer tmp_dev assignment after the NULL check.

chip cannot be null in st33zp24_send, please remove the bogus if
instead.


I get it.

Thanks for clarifying.
--
Gustavo A. R. Silva