Received: by 2002:ac0:adb4:0:0:0:0:0 with SMTP id o49-v6csp5573imb; Tue, 10 Jul 2018 19:27:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdruBAlmQKAwzed/s57+qriOIgV9u2oWxSKum+UUEq9YZhcQ+QkctI2LVynCRjS2KRzHu54 X-Received: by 2002:a17:902:784d:: with SMTP id e13-v6mr26483858pln.197.1531276021472; Tue, 10 Jul 2018 19:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531276021; cv=none; d=google.com; s=arc-20160816; b=HjIHrAIVyXMZQkjDkIQH8qGqKS3pGHGRfvaQrFkw7jk8fcTXch0+H9PzQ+71/r86dx CQXn+UZU0xgYGckGK8aElh7zmug7htFQcEIcuWdtgn1PGpWN/J23tcWvPIlnd5XHXRLV pmSUan8Z1ak7pZKwPTwoxuep4EC5Adb+8dC3oQJO6f+DY3HFAclAOgwTZUx9piRmv93L //+ZUIVYSiPOkfNbkkF9IPWtxHSqd4fg5VHZqIw7uEkaTo4mCCrHzMkJljwDvN4aFMzg G28hHXDKejHduEiFnT3R27ptoB5PnDzBmeLtca+qSwDrGANes6AtHzPbixrHa7Ln5tZY Np6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yPX8QbIoWG6JbcQNJPHxRDJ2rzNDYCCZk/fpseRdWHA=; b=A5hz3Mymd97lRiEl8IM14vKUNcfFzHtQYgTDZa+o88BdQULDxpbnyKyEN9wHn/7uui EYhtQxQ5/E+4LYK2GtGnq9BJB7WOG/+qSXjJ7dKUr1c4nmEAtbodjFrkpYF5zWgxn9jL W9RHDYssD+QTfyvD/70PxwWbN192e0kRaFuy2b3QZb4KCHOCXmGbKa0Uuuf46DNrWTD/ 2FJNjV65zNEJ6RK0ugweEjvIYEHj+/U3HN1x1jvFB7k0EFvRbXGfEsjgil+Kj32Xs4Nz 9l0dsvkxQMDBxiHYw4WAISpun72CfrXPQYwll3yx6C70lsK7X9LVQsKTgb9FTyXu6PaO c50Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7-v6si18940828pfg.308.2018.07.10.19.26.46; Tue, 10 Jul 2018 19:27:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732480AbeGKCYF (ORCPT + 99 others); Tue, 10 Jul 2018 22:24:05 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:45512 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732355AbeGKCYD (ORCPT ); Tue, 10 Jul 2018 22:24:03 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fd4la-0003HW-Gm; Wed, 11 Jul 2018 02:22:06 +0000 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Miklos Szeredi , stable@kernel.org Subject: [RFC][PATCH 03/42] ocxlflash_getfile(): fix double-iput() on alloc_file() failures Date: Wed, 11 Jul 2018 03:21:27 +0100 Message-Id: <20180711022206.12571-3-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180711022206.12571-1-viro@ZenIV.linux.org.uk> References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Cc: stable@kernel.org Signed-off-by: Al Viro --- drivers/scsi/cxlflash/ocxl_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c index 0a95b5f25380..497a68389461 100644 --- a/drivers/scsi/cxlflash/ocxl_hw.c +++ b/drivers/scsi/cxlflash/ocxl_hw.c @@ -134,15 +134,14 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name, rc = PTR_ERR(file); dev_err(dev, "%s: alloc_file failed rc=%d\n", __func__, rc); - goto err5; + path_put(&path); + goto err3; } file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); file->private_data = priv; out: return file; -err5: - path_put(&path); err4: iput(inode); err3: -- 2.11.0