From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750969AbaETVys (ORCPT ); Tue, 20 May 2014 17:54:48 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48797 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbaETVyr (ORCPT ); Tue, 20 May 2014 17:54:47 -0400 Date: Wed, 21 May 2014 00:54:31 +0300 From: Dan Carpenter To: Rickard Strandqvist Cc: Greg Kroah-Hartman , Xenia Ragiadakou , Peter P Waskiewicz Jr , Ana Rey , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8192u: r8192U_core.c: Fix for possible null pointer dereference Message-ID: <20140520215431.GG17724@mwanda> References: <1400621573-7672-1-git-send-email-rickard_strandqvist@spectrumdigital.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1400621573-7672-1-git-send-email-rickard_strandqvist@spectrumdigital.se> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 20, 2014 at 11:32:53PM +0200, Rickard Strandqvist wrote: > There is otherwise a risk of a possible null pointer dereference. > > Was largely found by using a static code analysis program called cppcheck. > Could you mention in the change log which pointer you are worried about? I think you are concerned about "priv" here. "priv" comes from container_of() and checking the return value of container_of() doesn't make sense. It does some pointer math so even if "work" is NULL the "priv" pointer would be non-zero. Just remove the check. regards, dan carpenter