Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp314600pxk; Wed, 2 Sep 2020 01:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSIsF2qo1tmpW6Frx2Q/YVA2T27ZMw0gH+Nhs/pmM9n4XanYuU+KhPucthpMtLunUsrk1V X-Received: by 2002:a17:906:82d1:: with SMTP id a17mr5147391ejy.385.1599037059532; Wed, 02 Sep 2020 01:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599037059; cv=none; d=google.com; s=arc-20160816; b=A1t9m/Q+LodHaahnLVuK+Znft1My6m8QdGbb6zNJTr3yOd56PFx8LJm2qgYlFGd1/Z iDqYSq97L9CICQWDA6oP0CLdvxQEv48QQ7kGfr0aeom2YJeZzmZkrCsKj/KcSbPMl6aH abEu6IyOJ639woMbwA2I9wIQRaMBeZ9FOrzH2PvTy13ZGsHin/DAmMPD0JlM9d7VYCFb otqoSxva9eDWhAqC1BM6ezQ/1eowUGkkjXsW3x1Q98o4dN/iPg6YtIXx2CufO7PdKa8N AfXTDcvz8yQ2FYnPkaQX+1FJKpUq6b1kbRhTTrOY+tBTAW/9WOq0x/mKvCgmkHXzj2HW 6DIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=208KQV1bvyHBJ8uP29I/NBcKCS4uB5/QUXDlH16JiHg=; b=edV1O719dk9fYIIM/5A4EF2mItb9VrudmubtS6LemGyDEp2AJOgwQ07pneZ6laRVq0 wWBmmThhpOcxc/l9+5RcEzoksd0tEhowcHENXbt3qMi2QSYkj6S2jHhhTESBJu3XOgZm Z0e0xqdY9dBBtBiiehMe5bZ8VYLwEGF5RHi92r8/FOiHIx7W2CTjhT2gZUSWx0ZhIIuX X0S17h21pxsTwKuyikZrBTVARXMaWA67DL4KmwvhuKh0He//jbhvcX8/jsImhYtrcQDG AZgGhTOesiGyAlfhMYzQfCuf2m5yf8BMk+7KmYx0FcLp+vKpC5HwI5NuUnta1vy8G9fB a8iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tP7I3x75; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si2114759ejm.314.2020.09.02.01.57.16; Wed, 02 Sep 2020 01:57:39 -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; dkim=pass header.i=@kernel.org header.s=default header.b=tP7I3x75; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbgIBIzg (ORCPT + 99 others); Wed, 2 Sep 2020 04:55:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:35078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbgIBIzd (ORCPT ); Wed, 2 Sep 2020 04:55:33 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91B422078B; Wed, 2 Sep 2020 08:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599036933; bh=KSfDn1rAofDp+IGlsS+1QKVw8oVSBvy/kgB52AVCOfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tP7I3x75qYFGfPcjUGPHKxG0VFwywevHXRUFfZDfrXdM4G6ADRucJNsc6Y4NgJtB1 pBqOJ8J7Bd9dBiPDRE53g+mlQuUusiVISC0BY+AETsIHspdVKPc+dp4ydGT7vR6fQt yAauxh1P7WYbdjPa8hUceQuedAadbsjafGM9gy84= From: Leon Romanovsky To: Linus Torvalds , Peter Oberparleiter Cc: Leon Romanovsky , linux-kernel@vger.kernel.org, Colin Ian King , Andrew Morton Subject: [PATCH rdma-next 2/4] gcov: Use proper duplication routine for const pointer Date: Wed, 2 Sep 2020 11:55:11 +0300 Message-Id: <20200902085513.748149-3-leon@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200902085513.748149-1-leon@kernel.org> References: <20200902085513.748149-1-leon@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky The filename is a const pointer, so use the proper string duplication routine that takes into account const identifier. Cc: Colin Ian King Signed-off-by: Leon Romanovsky --- kernel/gcov/gcc_4_7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index 6d706c5eed5c..318211deb903 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c @@ -283,7 +283,7 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info) dup->merge[fi_idx] = info->merge[fi_idx]; dup->n_functions = info->n_functions; - dup->filename = kstrdup(info->filename, GFP_KERNEL); + dup->filename = kstrdup_const(info->filename, GFP_KERNEL); if (!dup->filename) goto err_free; @@ -359,7 +359,7 @@ void gcov_info_free(struct gcov_info *info) free_info: kfree(info->functions); - kfree(info->filename); + kfree_const(info->filename); kfree(info); } -- 2.26.2