From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH] char: tpm: fix potential null pointer dereference Date: Tue, 30 May 2017 16:21:19 -0600 Message-ID: <20170530222119.GA8643@obsidianresearch.com> References: <20170530220520.GA8713@embeddedgus> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170530220520.GA8713@embeddedgus> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Gustavo A. R. Silva" Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net 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 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot