Received: by 10.223.185.116 with SMTP id b49csp35650wrg; Sat, 10 Feb 2018 01:44:32 -0800 (PST) X-Google-Smtp-Source: AH8x227lqGsVgpXbvuXu6BKbGtS6oPkmbrX4Ccld9jKf1HxfS68OdyDCpvjlLfRtG+scxhGBHeq2 X-Received: by 2002:a17:902:6843:: with SMTP id f3-v6mr5103144pln.182.1518255872721; Sat, 10 Feb 2018 01:44:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518255872; cv=none; d=google.com; s=arc-20160816; b=mDwQNiRV2yek35yYKMyYVzY9+UDnC7GF0TSJq9o+j41aFRHo9po3w1XvQPrWd4YHFR ZW90kFiMPbOYEH40z1Euds8xIJMb30tSONi8+Q0m7pKzr35uJrCJSYrpxyDdtKdQgWG/ EcWFFcE6yojdw4ESO0Ct2uTUDt9CU1P4BXcc9zgNj67dutkvxjxw/OFL5U/L0gFhBpM/ Ywzu3fDXg/ZX4RzXuFTKvBcQiqGAUdH9SIEWOi/IyiEtOd0m7uvyYwQjlLfikvNaljgY 1tfWcFrXNt6jfhOia38iaPJyFbEp0ovrJ1/HHIrnRWK2hCY/w0cdyqKcHF4OuXh8Iraa L9jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:user-agent:message-id :references:in-reply-to:subject:cc:to:from:date :content-transfer-encoding:mime-version:arc-authentication-results; bh=rL/eNHe3L8NKB20T6nn76BBbQNRhvxADpZXTCHDeJPg=; b=UENBgvUq2gw/CrBckmp4c34m9C2LtkchZMTgyZp2D6yBzmatkzNe467GCL3N1MpyZt c958M4/FQGaD/6OHTKOv9XLgnqgwKTMvggSS6ZwvpZiaqmwhMZRgEPme8BSfVCIsOlma 23eDwic+jtUKjbrDSMugzB6g3KSpfFxX54tYABmEBXtsfxSZtT956ba4HnWpM4dT0f39 b2dT8XniyQfo8BrM/vwMH0jSkuP1friQKkOam3Evm2wVrjskU19hlNsXWzInfayQlSEx ypOa9llzQqH2GaIsCwfyKp10LIDYDSFnddweGVZlbX0ghCIvjDK5DVaHieIRB9ZU5Smb q1PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=gSjCjwJp; 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 l10si2558035pgs.97.2018.02.10.01.44.18; Sat, 10 Feb 2018 01:44:32 -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=@agner.ch header.s=dkim header.b=gSjCjwJp; 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 S1751248AbeBJJnW (ORCPT + 99 others); Sat, 10 Feb 2018 04:43:22 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:46210 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024AbeBJJnV (ORCPT ); Sat, 10 Feb 2018 04:43:21 -0500 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 0A2735C0E5A; Sat, 10 Feb 2018 10:35:53 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sat, 10 Feb 2018 10:43:19 +0100 From: Stefan Agner To: Alexey Khoroshilov Cc: Boris Brezillon , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH v4 3/3] mtd: nand: vf610: check mtd_device_register() return code In-Reply-To: <1518215316-21504-4-git-send-email-khoroshilov@ispras.ru> References: <1518215316-21504-1-git-send-email-khoroshilov@ispras.ru> <1518215316-21504-4-git-send-email-khoroshilov@ispras.ru> Message-ID: <8a096fc8dd3afbf9068a0b7856fc8a69@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1518255353; bh=rL/eNHe3L8NKB20T6nn76BBbQNRhvxADpZXTCHDeJPg=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; b=gSjCjwJpAaY91NHS0gw5h04MaqHCp2bJWrhEkqKgquYa4EcuqZISPWYv4zhxL6asnCl+p+8bTGbJ5PosPph84Gv6Kr+NnwtVOxpkPlnr3i7yl7f3JZlHzYtY32w3fhU1rcxuH/2EeQI9OxkFrJVNvLNu8a1zxhnwJh/WEH81u4M= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.02.2018 23:28, Alexey Khoroshilov wrote: > vf610_nfc_probe() misses error handling of mtd_device_register(). > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Alexey Khoroshilov Looks good to me, and seems to work fine, thanks for fixing this! For the complete patchset: Reviewed-by: Stefan Agner -- Stefan > --- > drivers/mtd/nand/vf610_nfc.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c > index 9cc5992e88c8..64fed3d9e3d4 100644 > --- a/drivers/mtd/nand/vf610_nfc.c > +++ b/drivers/mtd/nand/vf610_nfc.c > @@ -782,8 +782,13 @@ static int vf610_nfc_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, mtd); > > /* Register device in MTD */ > - return mtd_device_register(mtd, NULL, 0); > + err = mtd_device_register(mtd, NULL, 0); > + if (err) > + goto err_cleanup_nand; > + return 0; > > +err_cleanup_nand: > + nand_cleanup(chip); > err_disable_clk: > clk_disable_unprepare(nfc->clk); > return err;