Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2209521iof; Tue, 7 Jun 2022 23:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz71NH/0PXHlQB+9MqMj2QQXDoupOsbUX4WKJVEp7FN45i+soi5xDSSZisA29Pe4T+galVL X-Received: by 2002:aa7:8d0f:0:b0:518:d867:bae8 with SMTP id j15-20020aa78d0f000000b00518d867bae8mr32237980pfe.13.1654669015886; Tue, 07 Jun 2022 23:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654669015; cv=none; d=google.com; s=arc-20160816; b=MPlnnol4FSiLvGMfExFRpns2v1uG+lSxTbxOuXZjCwqODj9DzdqjraCAJoz0wJ15xG bfLdvdAS4JhEmJV4cukKa+fhDXc1cjHavdFrXfT96zXmNEej4kNVf2f4F3RmsW2jxZut 4Re+7Tc1ukl1awuduvHQRNhATlutztRyUM1utwaJkuEeEzS3t5BKjmttxbHWkJl5FnBg lw0Jiyn/OEGBtkMYd4oG8qQl2fma7i9JR7LB87DY/Icd/bjsq4GQs14oUephvZaYxHhV JCoW0HlvhfbEJabUvWo1lASlLFV8bt/9H8kkzFRo3/1d/qEh+nTGk/Ej+z3GVfhUzrBp ErWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=rSkCLfMyuUVu/XoB6xe24vdHLxcfFSixZHn8nE4mV6I=; b=iNXagRaut6qrVgZup0RKidOPAmtBHNIvcqFGuL83l04OJOOqdkdZ9YAqIMpSnCeEfW Rdn6+nlg9lLoplpI3mMSn4r8KD4gPlF/Uwx0glzfT03XXtqbthfg5YyKkAtAbpoQrNCX RnoOZQ0ygiyIoch0ikAVjGuouYr6xsx43bD5k/zZjEae4Xt2KRKe7og1Ga5EfH4t2+pA v1JXvPpSKqbwmY3FaGS/yF68DWVJX4JE/GBPB+Y2omgT3DYabUOKweFog+h04sZE0F9e Mm7NqRM3wg21j96U3kVEB1vVHUcQ6kTG8XdhRgTzZoBn2Q2DVsl2Xr8yl9WqSPBHIUBL H/ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f69-20020a636a48000000b003fdb97e14adsi10625950pgc.752.2022.06.07.23.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:16:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46375362C77; Tue, 7 Jun 2022 22:38:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245725AbiFHBsL convert rfc822-to-8bit (ORCPT + 99 others); Tue, 7 Jun 2022 21:48:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447089AbiFGXGX (ORCPT ); Tue, 7 Jun 2022 19:06:23 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DAA1DE8C4 for ; Tue, 7 Jun 2022 13:30:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 39C0361B8B4C; Tue, 7 Jun 2022 22:30:29 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HT-WCvRXO0X0; Tue, 7 Jun 2022 22:30:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id AFAB261B8B68; Tue, 7 Jun 2022 22:30:28 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 13BXEJVUW9oh; Tue, 7 Jun 2022 22:30:28 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 8F1A061B8B4C; Tue, 7 Jun 2022 22:30:28 +0200 (CEST) Date: Tue, 7 Jun 2022 22:30:28 +0200 (CEST) From: Richard Weinberger To: =?utf-8?B?TWljaGHFgiBLxJlwaWXFhA==?= Cc: Miquel Raynal , Vignesh Raghavendra , linux-mtd , linux-kernel Message-ID: <75745632.147517.1654633828458.JavaMail.zimbra@nod.at> In-Reply-To: <20220516070601.11428-3-kernel@kempniu.pl> References: <20220516070601.11428-1-kernel@kempniu.pl> <20220516070601.11428-3-kernel@kempniu.pl> Subject: Re: [PATCH 2/2] mtdchar: use kvmalloc() for potentially large allocations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: mtdchar: use kvmalloc() for potentially large allocations Thread-Index: GV6LOGkacTyBnlb9cH8NJV3ZRtoFFQ== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 ----- Ursprüngliche Mail ----- > Von: "Michał Kępień" > An: "Miquel Raynal" , "richard" , "Vignesh Raghavendra" > CC: "linux-mtd" , "linux-kernel" > Gesendet: Montag, 16. Mai 2022 09:06:01 > Betreff: [PATCH 2/2] mtdchar: use kvmalloc() for potentially large allocations > 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ń Looks good to me. Acked-by: Richard Weinberger Thanks, //richard