Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp757199ybl; Wed, 4 Dec 2019 10:20:26 -0800 (PST) X-Google-Smtp-Source: APXvYqyVTSGiLB7W29+GTfRC+VWuy7MlNcnzyVQ2UH2Jbvmfd/UczscBf7ZTTRMgN11a1n2IhUN5 X-Received: by 2002:a05:6830:563:: with SMTP id f3mr3412750otc.276.1575483625931; Wed, 04 Dec 2019 10:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483625; cv=none; d=google.com; s=arc-20160816; b=wsmauClXBjq4lkj056ftp0JRmEHv3fIlfdxTIIJZy8zaFJwXfyUnCv5UShmylYpxau 8RZkJrCox15dA8IF/iH+wOO2oJjp4qwPrc0I1CHjbG4ZnShmdM/Pe3Mz0WtwYemXqbPI ngymYd/X64HW8F13gbVnVSChwpfYL/P3u9F78cVfPI/q8gpca3COcuaz0HR1kGmqIg9I ttsboEpK9K3WFSU27yZQAl6S12MVbkCiRLLeklxS8MoFHznTwyXSbgv0GMVrh5gHiT80 HTRasp19MH07MvmFM859RSVYQ5gdAOWIp5ZorQ638/WDglVeKJ6HWiybUQJbDPQE/6Ro iw3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V3mxHIzDenwoCvCx3tia9FnSbZYb4dqlofOSQma5UYs=; b=w8w9Yscn584GF/8pVSLX8+fcgI0oGf0pR1EwmY6iOkWWo92TNRYNiE51G5r0u8RtmT RSqdxmrb5vqbhgFWT5ABnclwwo0KYCI816pzf5pXE0b+LHRMfpPeKpWbEIJCSSgivC4x OaV1vxfxQbR30SQs4qztcJAzfgV3lswg+bZFySj4d5knULpEI2mn3G2/JTYUHFbl2MIq /hgVFjjEIbwmtoHnVbFJDfLEA9UyrOMSk8bmupEFzPn4PyVWaPoqBvf/1M90Z0JxqCrG lWE08W5moPRBB8lg0iWScq/psgOusBRxZwbqZ9wTIZR08zAFctFMRwS9rZCtfOVi2m/P cPvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rszgw9KY; 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 p129si3533972oig.118.2019.12.04.10.20.13; Wed, 04 Dec 2019 10:20:25 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Rszgw9KY; 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 S1731611AbfLDSSd (ORCPT + 99 others); Wed, 4 Dec 2019 13:18:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:38604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731324AbfLDSKu (ORCPT ); Wed, 4 Dec 2019 13:10:50 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B755220674; Wed, 4 Dec 2019 18:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575483050; bh=9FiMZ05AyP9vz7NADwi6aGobRVfRNQnwiHXVl7PW3TM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rszgw9KYMNuK8mhNTu4sh6yg/9SPYWKZwfjh+TQiiMKLOS43DfnvPKwo+fLWdNihP 0oWObN/ezM61MYAH6ziM4p3CEl9+48GMMp3xL+qJ8QIwrOZfq1bCSpISyVr3gkwk0r 5Q0y450NhibkZovc+IWkhLhmu0DpLzB8gjhvEVeQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Boris Brezillon , Richard Weinberger , Sasha Levin Subject: [PATCH 4.9 030/125] ubi: Do not drop UBI device reference before using Date: Wed, 4 Dec 2019 18:55:35 +0100 Message-Id: <20191204175320.478059871@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175308.377746305@linuxfoundation.org> References: <20191204175308.377746305@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 88b1897aeb40f..7826f7c4ec2fb 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -227,9 +227,9 @@ out_unlock: 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