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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,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 3BB19C2B9FE for ; Mon, 10 May 2021 11:00:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D89F61991 for ; Mon, 10 May 2021 11:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235101AbhEJLAC (ORCPT ); Mon, 10 May 2021 07:00:02 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:52707 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232968AbhEJKow (ORCPT ); Mon, 10 May 2021 06:44:52 -0400 Received: from xps13.home (lfbn-tou-1-1325-59.w90-89.abo.wanadoo.fr [90.89.138.59]) (Authenticated sender: miquel.raynal@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id C8E54240005; Mon, 10 May 2021 10:43:46 +0000 (UTC) From: Miquel Raynal To: Yang Li , miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: return -ENOMEM when kmalloc failed Date: Mon, 10 May 2021 12:43:46 +0200 Message-Id: <20210510104346.10947-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <1619429543-52234-1-git-send-email-yang.lee@linux.alibaba.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'8fa7c3618e8abcca09e16a1c9048b8e78bcf803d' Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-04-26 at 09:32:23 UTC, Yang Li wrote: > The driver is using -1 instead of the -ENOMEM defined macro to > specify that a buffer allocation failed. Using the correct error > code is more intuitive > > Smatch tool warning: > drivers/mtd/inftlmount.c:333 check_free_sectors() warn: returning -1 > instead of -ENOMEM is sloppy > drivers/mtd/nftlmount.c:272 check_free_sectors() warn: returning -1 > instead of -ENOMEM is sloppy > > No functional change, just more standardized. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel