Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1748370lqs; Sun, 16 Jun 2024 02:58:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUze3vIqshDI7zGUonyaIOMXGqHM/pl0deARfTZhjEDTUIydVFJQ74EEne4O9UopKwwIPhXeWsN7U04aHkONLJMOK6IlqVKdnQMP/yOVQ== X-Google-Smtp-Source: AGHT+IGFvkMiyXhxilxKC9z7pgzXtJ8a4/EYVDjgHGSX1hqsvR43+h/B/OWFHgwjoCpt1oJHA6th X-Received: by 2002:a17:90a:bf0c:b0:2c2:f7be:f668 with SMTP id 98e67ed59e1d1-2c4dbe3c81amr6520478a91.42.1718531937804; Sun, 16 Jun 2024 02:58:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718531937; cv=pass; d=google.com; s=arc-20160816; b=sX2inJ4QSuX7pLvNK3dLlWOtyyscnddUuanPRD7n7OQhX4e82xUPw8vVJtG284oOWB fGKHPyuusTqmQntocZZwGMVYOqsDd5dX/sKwUkkMOgUoS2hx2CTiBlj+k1cGTXQcajHJ qVaXKqByYQVzox66H07PWXbxfRymUCeXQ9o4bzGwFTyLGp06IGmHA2YYL4cXyDA4U/Sa N/BYjaiyqlYSWUh1njyignjeP57cl0F+yZYQS1keFTPXT3vM0pMyzxCU4z6MjRLBOEBH fR9B5aSi7rgROavGriX1Q9SyIg37WXgGPteAUDJPyc30V0HyeTU3yhh2kb5A+t6IdZs8 uWqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gTatvtTeekkSX10gQ/J0cxEW4/Z/yX1LGHWfAzK22Jc=; fh=ncOPkQLJDrnRpjUTNVG9Iqt/Dw+eF8lOZJtmRKpgL38=; b=MsqA7CSfnuPX7JNu3/TeGTh2frPMrdkYW+syPBr09AYRm9UvzXWz1ZcSB6t/dV8Onv 6h6VePQiwckH8aejGq3/FwcaQL83lt0vttmVBpDQiM0F/Rb8yn/Jz12DmzrvK2eAjdSo wuRPA+fAygfNFikrp/FWe6lms1AOv4x3ASk+l3zg4U1r9rvEqMX3uRdo2EaFHngjDrOg MYwNZxRX11tWNOdVF+Qkb90saAa4ci/V13+UA09u85kICF3uOGnZak9VZP3EE0/FWCsy n7cJDTXPaQg3KHWSNxIG1GE2zVptnAyT0Vu4j1KWVAxiZTkX0OBbnDIijaCihxRflN4Z 1ukQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XWyrYZ0k; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-216226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4ab2ef7d0si9414617a91.82.2024.06.16.02.58.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 02:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XWyrYZ0k; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-216226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D270CB20FB8 for ; Sun, 16 Jun 2024 09:58:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79FEE1862A4; Sun, 16 Jun 2024 09:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XWyrYZ0k" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D1F08F54 for ; Sun, 16 Jun 2024 09:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718531926; cv=none; b=I9CREhWCtR69pBj3Umh5P7CZi/Uu2tfiXFdqDkz2IFb7kl8tbPchOdef4FOtuOzeEGYpJSdChKeglRhX20LjdXadosAlM2c0HvpFCBGg0Z1lr96F8Lfi3QXRPrflw+0JIXnC5zEZlabP3FKp8e/YUq6W2ZwBSlnTZphShYPAPr4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718531926; c=relaxed/simple; bh=DejFUb5PkXNfmRFEK/KK+kGZeHnMceNJrm8Hw3xMm9w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TNjlR3d/pQzYjpjRIfzqZHlWRbPOVnNqzUoVwpIRVW4l7apC9kcYqjlVt4QS5O85AxU6oO6nEzHT5h4CYNhckm+KZq+praKZlqaiAjbWXymXmJJuUX4I5vSFPMwt7ycXNaZ0C1eLncS0+AIkjJxh5Nw35R/M05K3O4jRFDBrEME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XWyrYZ0k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADF61C2BBFC; Sun, 16 Jun 2024 09:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718531926; bh=DejFUb5PkXNfmRFEK/KK+kGZeHnMceNJrm8Hw3xMm9w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XWyrYZ0kVHOJzAbxGTW5SqKWGNPRFCawZ8ILmfcmyxkBfOPvGjTlpQgCspkqVF+vv V42ml2xvAOgy8wY7kGyCJPfi4sS2YIEqVvQmCeNDag1QqJ4z9+T4Isiu2rUhQUTZQN 7ohr3mPWFbpuuHQPXinQIUy8qXwC1b2FYHx7ZG+Q= Date: Sun, 16 Jun 2024 11:58:43 +0200 From: Greg KH To: Zijun Hu Cc: rafael@kernel.org, andriy.shevchenko@linux.intel.com, brgl@bgdev.pl, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] devres: Fix devm_krealloc() allocating memory with wrong size Message-ID: <2024061634-stack-plop-6aff@gregkh> References: <1718531655-29761-1-git-send-email-quic_zijuhu@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1718531655-29761-1-git-send-email-quic_zijuhu@quicinc.com> On Sun, Jun 16, 2024 at 05:54:15PM +0800, Zijun Hu wrote: > Kernel API devm_krealloc() calls alloc_dr() with wrong argument > @total_new_size, and it will cause more memory to be allocated > than required, fixed by using @new_size as alloc_dr()'s argument. > > Fixes: f82485722e5d ("devres: provide devm_krealloc()") > Signed-off-by: Zijun Hu > --- > drivers/base/devres.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > index 3df0025d12aa..1cf87ddf1f55 100644 > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -898,7 +898,7 @@ void *devm_krealloc(struct device *dev, void *ptr, size_t new_size, gfp_t gfp) > * taking the lock as most probably the caller uses GFP_KERNEL. > */ > new_dr = alloc_dr(devm_kmalloc_release, > - total_new_size, gfp, dev_to_node(dev)); > + new_size, gfp, dev_to_node(dev)); > if (!new_dr) > return NULL; > > -- > 2.7.4 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot