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

From: Jason Gunthorpe
Date: Tue May 30 2017 - 18:22:04 EST


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.

Jason