Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp414242iol; Thu, 9 Jun 2022 06:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytedP+tb1yT5ElzD4W0fWBGk2fvTs8pMoDicvjdQcEvgjsGUOyYuS8YqVHYHNdKNTcDfGO X-Received: by 2002:a05:6a00:c89:b0:51c:2ad8:47ad with SMTP id a9-20020a056a000c8900b0051c2ad847admr17508523pfv.42.1654781192946; Thu, 09 Jun 2022 06:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654781192; cv=none; d=google.com; s=arc-20160816; b=t6Jn9aSZhLLyobXVODG+RxVLqxa2ep4ZQG2RARELgxURBU40Wu83sz2rUzVupCDAyo AUUySE4qrb0B+szFOHGKfYqnsOdMXZ6DqFTE5KdHvY6rhUBex2iqcJ0tChSBYs6KLQkx XuczqyibHq1XN57d5dwcs9IaqMqiHcAnpj/i2Z4sf29NMf26zRAkbmQoI6YfPkz+owak yVAgASzddyKkzwvmBV6W740DKnsTq8OMlKwtg7x7oa1i2WU6xZpJeN5ZKAxxfoesfaAV M4Rp8wzqD/lEl86vwnetVU2UIXKm7BPV0TPKhGYmurJwmDMjaXPYnCS0ZNKyJE7jpWLz E5dQ== 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 :dkim-signature; bh=ITj+D6pf4vtJjIg4YV1QMKa+PIL6lnpS+3b87tjq90M=; b=YTtmbp1cD1sWu+GmaFDwZKlValNpvXxaQzcROLI8X9vnrvgG+qUj7OLs+mMD20sPPs Q/Yq3bxj2xcY4mflqA/41ABmcluMFK+0kRhetdfVNhDLWlONOPbh6KJ+Q91/HFGHjfks a3TRLa+wvKKafDOs+iLufRuWDNlKLjkQUxfqV+aQrizNM/uulJpZe9FGDsgYxmmbaNUv cFQeh59aoi4/KUZO9dHgYdNcAaZdmnHCY4y5PKsLuGH9kq/HTJtcCqwdA+xG5fYj4W4S LFeZbpT73g+oMigVDAOvhQl3GmuCknYVKfKai14G40Q7x9L6gsvCKxZgN38/MbPvWFul WC4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mAkTn72l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a170902eb8100b00161bc840c77si31248362plg.548.2022.06.09.06.26.16; Thu, 09 Jun 2022 06:26:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mAkTn72l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240688AbiFINKa (ORCPT + 99 others); Thu, 9 Jun 2022 09:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbiFINKY (ORCPT ); Thu, 9 Jun 2022 09:10:24 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB87AEAD01 for ; Thu, 9 Jun 2022 06:10:21 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 40FC5FF807; Thu, 9 Jun 2022 13:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654780219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ITj+D6pf4vtJjIg4YV1QMKa+PIL6lnpS+3b87tjq90M=; b=mAkTn72lcLs7xI8y9hbrIHnbX5b18ahqU2B5H+lbYuyxFIdQoaezMhxlGYOqMc5GqppSaX wqOnCCaLWC/nPa/NnTnqU1H6GNdll7X8RLDrmc9yOP6VCj8pgDyU0bIOefXuRFzJX8rihP ZAIYPo3L08gnZPKBj08D5veCGppkuMjMaBz4IGvfnS94kzCJQoQqawYVEnmbAwvQQhAxDQ VkEu4bd2+cV7HXpHP4HyFvMFIUIHP+h946m+wfIoBLUBQSfdmqbTAY0+YJFE/BgtdGhR6S 6SuVe2ghmdDJORoON1KMf2H4mz/E0xDvs8P1SsNad3Sbw9F7bhqDiZqzObmjmA== From: Miquel Raynal To: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mtdchar: use kvmalloc() for potentially large allocations Date: Thu, 9 Jun 2022 15:10:18 +0200 Message-Id: <20220609131018.293486-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220516070601.11428-3-kernel@kempniu.pl> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'83208e106a8e8a859110ebb04a5e927ced911afb' Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2022-05-16 at 07:06:01 UTC, =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= wrote: > mtdchar_write_ioctl() calls kmalloc() with the 'size' argument set to > the smaller of two values: the write request's data/OOB length provided > by user space and the erase block size of the MTD device. If the latter > is large, kmalloc() may not be able to serve such allocation requests. > Use kvmalloc() instead. Correspondingly, replace kfree() calls with > kvfree() calls. > > Suggested-by: Richard Weinberger > Signed-off-by: Michał Kępień > Acked-by: Richard Weinberger Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel