From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD3DEC43215 for ; Fri, 22 Nov 2019 06:14:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 643922068F for ; Fri, 22 Nov 2019 06:14:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PJVVtuXz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="XYI19S+I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 643922068F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PfNxW2v0Y4et0E+6erxolg6jQuqvV3WwrxtAMw+R/vI=; b=PJVVtuXzz185lK 6TpsXNbg6OnJe4xPvNvv/ZvFF3wPoiNa3bo1Y5tfyTkYG1r9Pv9ldf9caViL8NJV1vb7Q8ad5Eurl Ck+SX0V52lgUIHiNpcvrXTgvx4mYvoKoYLuv4u6sQVKiWsi7VhTI7kZplTd8Js5Alj+WU27kLsUwY g8ZiI7+qT/zgGP8NpHbQ/2JaOIh5FOH+A+JbXHvJxA5AlmUFBg2HoIOcCixUEgdjlUQrjquoj1m+f 7jEZbeFlBmgsPZNHIrr2821n2D8WbOL8nxQliwaVnW/fH8+peaxw+TGOzScSWNrrX8S8EFqFEzcdr HE63sjRX4hmXJPy7VeOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iY2D6-0000qW-R3; Fri, 22 Nov 2019 06:14:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iY2C0-0008On-UG for linux-mtd@lists.infradead.org; Fri, 22 Nov 2019 06:13:23 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E8C520718; Fri, 22 Nov 2019 06:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574403199; bh=fjy17N+8wdzjyqHZ76SU5Xme8YPiQP/2h93T/bPWYpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYI19S+IrZMQbWybvyyB8oqMEb0008ZcDnBvOpMb6UQrwnu1TkJGEqajMKOA8dyjt 0u6t2my5lu6bqFBLEbv8CZmf4GCsFe74i9OsWTazQU8JROLyANqEvehs30U5My4HNT HWA9G/QDhiKXnfho0MnUDgbo2aeS3CGhSo6ynbNE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 16/68] ubi: Do not drop UBI device reference before using Date: Fri, 22 Nov 2019 01:12:09 -0500 Message-Id: <20191122061301.4947-15-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122061301.4947-1-sashal@kernel.org> References: <20191122061301.4947-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191121_221321_109746_2B9A4BA7 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Boris Brezillon , Pan Bian , linux-mtd@lists.infradead.org, Richard Weinberger Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org From: Pan Bian [ Upstream commit e542087701f09418702673631a908429feb3eae0 ] The UBI device reference is dropped but then the device is used as a parameter of ubi_err. The bug is introduced in changing ubi_err's behavior. The old ubi_err does not require a UBI device as its first parameter, but the new one does. Fixes: 32608703310 ("UBI: Extend UBI layer debug/messaging capabilities") Signed-off-by: Pan Bian Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- drivers/mtd/ubi/kapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index e844887732fbd..1db375caef71b 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -227,9 +227,9 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) out_free: kfree(desc); out_put_ubi: - ubi_put_device(ubi); ubi_err(ubi, "cannot open device %d, volume %d, error %d", ubi_num, vol_id, err); + ubi_put_device(ubi); return ERR_PTR(err); } EXPORT_SYMBOL_GPL(ubi_open_volume); -- 2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/