From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934004AbcIAPxM (ORCPT ); Thu, 1 Sep 2016 11:53:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53284 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933516AbcIAPxL (ORCPT ); Thu, 1 Sep 2016 11:53:11 -0400 Date: Thu, 1 Sep 2016 17:53:19 +0200 From: Greg Kroah-Hartman To: Sudip Mukherjee Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] staging: ks7010: return on failure Message-ID: <20160901155319.GA7842@kroah.com> References: <1471977456-7784-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471977456-7784-1-git-send-email-sudipm.mukherjee@gmail.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2016 at 12:07:35AM +0530, Sudip Mukherjee wrote: > On failure we were jumping to error_out0 where we were trying > sdio_release_host() but at this point of execution we still have not > done sdio_claim_host() and as a result host->claimed can still be 0. > And if host->claimed is 0 then WARN_ON(!host->claimed) will give > a warning. > Moreover, if it is still not claimed then mmc_host->claim_cnt will be 0 > and mmc_release_host() will do "if (--host->claim_cnt)" and thus the > condition will become true. > Lets just return the value on allocation failure instead of trying to > release the host before claiming it. > > Signed-off-by: Sudip Mukherjee > --- > drivers/staging/ks7010/ks7010_sdio.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Please always cc: the maintainer of the driver when you send patches in. Please fix that up and resend these 2 patches. thanks, greg k-h