From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Slaby Subject: Re: [PATCH] qla2xxx: Fix Null ptr dereference in fail path in queue create code Date: Fri, 25 Sep 2009 09:48:36 +0200 Message-ID: <4ABC75D4.1020207@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from fg-out-1718.google.com ([72.14.220.156]:6789 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477AbZIYHsf (ORCPT ); Fri, 25 Sep 2009 03:48:35 -0400 Received: by fg-out-1718.google.com with SMTP id 22so806585fge.1 for ; Fri, 25 Sep 2009 00:48:38 -0700 (PDT) In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Anirban Chakraborty Cc: James.Bottomley@suse.de, linux-scsi@vger.kernel.org, Andrew Vasquez On 09/25/2009 09:45 AM, Anirban Chakraborty wrote: > Current code jumps to fail path in queue create functions and there it invokes > the queue free call with a (NULL) pointer to the queue which could not be > allocated. Fix it by returning ENOMEM directly without invoking the queue free Sorry, staring at callers now. They expect 0 on error. So both my and your patches are wrong in this manner. There should be 'return 0'.