Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp853467imu; Wed, 28 Nov 2018 00:09:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/UI7gc96WTOEe2U9BrQVgbFEXdVIeHAGIMM8fKJf8K7KcwZwgmoGXRV1xtTsa9XDL2Lu5zc X-Received: by 2002:a63:4c6:: with SMTP id 189mr32649396pge.391.1543392563864; Wed, 28 Nov 2018 00:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543392563; cv=none; d=google.com; s=arc-20160816; b=hbJAXHVqAp50hDF4v+NeCyganNbXIu8J3HVCBlQqbK557R0my0g1TKJTS4uuUVgKD+ RbuqCxL0FXmWe7dASsZlEAc8v7vDQCTNMgNgp1qisX1Di3ojJ9Y9sHAbFPmOoC/Lk9cx g4qGFkS9xVX06661NbTUwbfesaxdoNTKlS97qIpQnQJdLHohmlCzu3Mz/szwbMnH7u3p pXUOdM2RNn0D0q5Npn5a+4qH88OiMBT8NHjhlM5CT3IQ8LoYL5pMfolk21igg71CkzKT Bseh/FQuPalZnBHF9DHyZkPJOPibwbclIKOMKkwgJtU8ayNZn1puHjqq2SD5ps3WK1Tq UITQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=lrAJ5YFXmUYEUBNzMfnw8Om7piF9HmJJos6mHLCZp1k=; b=Bt1/IhlgCmenMyNaQ3cc1+2oSjHDaSK3LoyGe6SdQyL6cu19Sucz22MvBmP2B7hqqa HSoTLBqbmdPBnyX4OOfho5+WcGarFiW1/9xDCPEgijEpZa6v//OVLS6XIN3/oVBuTfnk 4n2SI+c+n2lX6EF90Ch8l2koweWUXz3ESF/tujBEq9vmOiCM6Scf8vMsav7qNup2H89o 1yKZvhfVzoCKKcH9jhLV817Ubesefs0BeVWyxQXKLNZ0N5qwHF+fU8hYrh1izVHKDxvh KnZHp9vNqiiKaaAtyK02KzcxY4HdKBsuSgiCA8ON6xHfv9GppLticFKy93+tiRMJHr35 eCJg== 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 h85si7098002pfd.27.2018.11.28.00.09.08; Wed, 28 Nov 2018 00:09:23 -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; 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 S1727806AbeK1TH2 (ORCPT + 99 others); Wed, 28 Nov 2018 14:07:28 -0500 Received: from mail.bootlin.com ([62.4.15.54]:40181 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbeK1TH1 (ORCPT ); Wed, 28 Nov 2018 14:07:27 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 7160E207B0; Wed, 28 Nov 2018 09:06:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from bbrezillon (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 31F9B20726; Wed, 28 Nov 2018 09:06:31 +0100 (CET) Date: Wed, 28 Nov 2018 09:06:30 +0100 From: Boris Brezillon To: Pan Bian Cc: Artem Bityutskiy , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ubi: do not drop UBI device reference before using Message-ID: <20181128090631.1a99f995@bbrezillon> In-Reply-To: <1543375203-97876-1-git-send-email-bianpan2016@163.com> References: <1543375203-97876-1-git-send-email-bianpan2016@163.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Nov 2018 11:20:03 +0800 Pan Bian wrote: > 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") > Unnecessary blank line here. > Signed-off-by: Pan Bian Reviewed-by: Boris Brezillon > --- > 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 e9e9ecb..0b8f0c4 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);