Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2475812pxj; Mon, 10 May 2021 04:02:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2IrT3SLkoF+Kf10kpSzfgeHFSu/viBqmRh9pjwex4XLrj8UG3yrEXNXIoVR5lIzpxGj8z X-Received: by 2002:a05:6638:2044:: with SMTP id t4mr21690842jaj.12.1620644536217; Mon, 10 May 2021 04:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644536; cv=none; d=google.com; s=arc-20160816; b=YJit7ruQj8ZT5m0yUUb3uf14MlIwnTQsnrEUQbED5A8NSWOtvCaZL6kuSlqiDJoDhq HSociHPauy/6CLAI8wldUTuY1NOnFpAByMS2kSOrA9RlJ/Izt1BMrpfMIyVwCPuhgK+p eIiyftBoa0dnIHx+8trtYXZT5/x6grtAR8rrXj8WYhfwV/1rspgoZqskYm2MvC1nvKY6 EDJm4j7pg6G/s2VYytEojr+4HPcnxiTIN+k7o6bxFyIEnHILcIRKEagGDB7KmBGx7++y /xWWRhf6xQrBsqdsUwBqnuwUTo42lhlTvUfjbVzjOrMBgCQue5xac+G8P1C5RnkPZtm7 4+fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=N+AbAkVfvYiMlvYw4xXzMY3phWKs26aHq5EaiITZSOc=; b=GHXkyWxUS0HEU7HI1Wop0SkoQrzQmual8X5MkMI0/WczgYCJ3m0xHk1iCRIEJ/CHf+ e8sgV6LTaZt4+eU6q/JoBOYUw6A3nYBXnqyeCPruLDIQQ8v/Du8CF4PPWmqKUzhiYBTg uMiTTlSFazmfHdMbFdcyBsxkT+onNkc3s0vjLjDQ3Kq/9y8GTad7JDOP70TleZGEQV1W NWZkKOyCQ33qofmdfUy36TTNwsVqkq1GAyvGRIuqzcuTOZPdBPXhZ55kJdiw3rlpB0pF z0bgxCGi6N6SPIKL/Yteu+7mQ19YpipFWzgTkwM6wOAy2Wg87u75XrBTTjvZZIia/oON A2Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si14701897ioh.103.2021.05.10.04.02.02; Mon, 10 May 2021 04:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235090AbhEJK77 (ORCPT + 99 others); Mon, 10 May 2021 06:59:59 -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