Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756086AbZFAINL (ORCPT ); Mon, 1 Jun 2009 04:13:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754005AbZFAIM5 (ORCPT ); Mon, 1 Jun 2009 04:12:57 -0400 Received: from mailgw3.cms.com ([202.75.200.223]:24514 "EHLO cms.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754365AbZFAIM5 (ORCPT ); Mon, 1 Jun 2009 04:12:57 -0400 X-Originating-IP: 172.19.23.105 X-Auth-User: vibi_sreenivasan@cms.com X-Filename: C:\PROGRA~1\MailScan\in\SMT9698954395626.TMP Subject: Re: [PATCH]:Return proper error value on failure of dentry_open From: vibi sreenivasan Reply-To: vibi_sreenivasan@cms.com To: Jiri Slaby Cc: Mimi Zohar , Kylene Hall , Serge Hallyn , Reiner Sailer , linux-kernel In-Reply-To: <4A238625.8060002@gmail.com> References: <1243836708.2163.3.camel@system> <4A238625.8060002@gmail.com> Content-Type: text/plain Organization: CMS Date: Mon, 01 Jun 2009 13:40:51 +0530 Message-Id: <1243843851.2327.7.camel@system> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 (2.12.1-3.fc8) Content-Transfer-Encoding: 7bit X-Trained: 2 X-MS-ContentScanSkipped: Mail Not From Internet Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 825 Lines: 32 hi, thanks for pointing that out. > > out: > > mutex_unlock(&iint->mutex); > > - if (file) > > + if (IS_ERR(file)) > > fput(file); extremely sorry it was if(!IS_ERR(file)) fput(file); i will send that patch again > > This makes no sense at all. If it is IS_ERR, i.e. some negative value, > you don't want to pass it to fput. 'if (file)' was perfectly correct. if(file) is true for file != 0 , ie even if file is a -ve error value. so while fput dereference file ,this can cause a bug to be triggered. I actually had one. Thanks & regards vibi sreenivasan > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/