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=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 18B91C433DF for ; Sun, 28 Jun 2020 15:25:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84346214D8 for ; Sun, 28 Jun 2020 15:25:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="uF+l4g7e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84346214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CA0EA6B0003; Sun, 28 Jun 2020 11:25:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C51BF6B0005; Sun, 28 Jun 2020 11:25:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B40B46B0006; Sun, 28 Jun 2020 11:25:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9DEEF6B0003 for ; Sun, 28 Jun 2020 11:25:09 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 168A72DFA for ; Sun, 28 Jun 2020 15:25:09 +0000 (UTC) X-FDA: 76978993938.08.chess37_191608126e67 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id DAA581819E76C for ; Sun, 28 Jun 2020 15:25:08 +0000 (UTC) X-HE-Tag: chess37_191608126e67 X-Filterd-Recvd-Size: 3853 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Sun, 28 Jun 2020 15:25:08 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id f7so11142959wrw.1 for ; Sun, 28 Jun 2020 08:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JUWSFKmiKbn7NS6OS++L4vNIhvchWhWVxfAVBsgRvRE=; b=uF+l4g7eUNlWJ3g5WmrOEMnhcwWVa+xZl7IwNA9S2Bg5iUkR2rDYNtjUy3eIE2f2/6 KFLJ0GTunExzOw6SpmBVM6pSpS3g3BiLRXzvm6dR2v4lOjiLzvlIeamGob4/oMgR8cCg guj7Au0NLqNG7W1DVnlTBAF12v9lXkU+N7YU7Ea/vC58uqqG5EyY+2yMgWyUvvP7LBbc EDKTtnciLEksujlmrzb4GB6MWCNQqrU4pTGLr5BuopZ06+D9oGeFsKHxpcqiQV8szXkG OtSjGO/UDT6FR3OY9dsXOFFGxcg7VgX/JlOIxUowWVJMuy8jNFuDb2FGqW8iPTqLjxLH ttsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JUWSFKmiKbn7NS6OS++L4vNIhvchWhWVxfAVBsgRvRE=; b=OdXLIYuZaDtVMrvVtUQVmCNeaY9hJdaykOZeBYp+RckzcdLundeHCZoa6lH9BN+HZW Ee+yjCRrRgscRuRbZtYICk4FAbxNRjYvKqrvIy0Dx4wpri0EfZs50QGNtTa2xSqrjKwh sqJyXs6Ow7ltlI2B0sXXYUugsMzLHm6OV/9pwYuW8Fyo+KcLNLqRPRUYg9PiPxw2q0kV EENtQlTatkj3QvkKFoN6+V0mz8xSlbDynfFyRSzoniZIE63Hr+Z0HzhDp0eP4b0YfVKs t3CUDTVTBaKzT63jUFEZqiyzkn4D33nYSEpjfkPalRCG1e05lAUHBm5OGTEuRux/+3Bt 5xZQ== X-Gm-Message-State: AOAM530xrelY4Qm2BOcKZHLfwo3P9lk+4DyasbS6L80UjWSeP1bnvCzp LGTPQdHYyrUSANbkdSqG+6I3Bg== X-Google-Smtp-Source: ABdhPJwsY9WWwujK5rvyBWdi7WdxbRQX7uQ9XLKMYiFWAnji8xfXQ5NwhNH5gYtRT/Hlvoq0AAmIGQ== X-Received: by 2002:adf:ab4a:: with SMTP id r10mr14254106wrc.103.1593357906969; Sun, 28 Jun 2020 08:25:06 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id f17sm26929450wrq.3.2020.06.28.08.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jun 2020 08:25:06 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] mm: util: update the kerneldoc for kstrdup_const() Date: Sun, 28 Jun 2020 17:25:00 +0200 Message-Id: <20200628152500.17916-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: DAA581819E76C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000693, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Bartosz Golaszewski Memory allocated with kstrdup_const() must not be passed to regular krealloc() as it is not aware of the possibility of the chunk residing in .rodata. Since there are no potential users of krealloc_const() at the moment, let's just update the doc to make it explicit. Signed-off-by: Bartosz Golaszewski --- mm/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/util.c b/mm/util.c index c63c8e47be57..27d6155edb8f 100644 --- a/mm/util.c +++ b/mm/util.c @@ -69,7 +69,8 @@ EXPORT_SYMBOL(kstrdup); * @s: the string to duplicate * @gfp: the GFP mask used in the kmalloc() call when allocating memory * - * Note: Strings allocated by kstrdup_const should be freed by kfree_con= st. + * Note: Strings allocated by kstrdup_const should be freed by kfree_con= st and + * must not be passed to krealloc(). * * Return: source string if it is in .rodata section otherwise * fallback to kstrdup. --=20 2.26.1