Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp733401pxx; Thu, 29 Oct 2020 13:08:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ+Tn1/xM9/ElPMDW2Ufp1Qghvx5gIg7TtAlDXNHQjC69BsqGbNKtiI1+TY9HjDydTk6LR X-Received: by 2002:a05:6402:b54:: with SMTP id bx20mr5823081edb.114.1604002105972; Thu, 29 Oct 2020 13:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604002105; cv=none; d=google.com; s=arc-20160816; b=V4RU5qBuN/oP1XY0mmQRHxv2pEtBpPm8O16iYUdxpSbSWokXDCYqxkICdPXtyZMaSr V73SdgZTQQGSsPyvz1I1wjDl+rbQuaYz4qZO6CMC31HymtT60JWyE4XxYKNOh1/3/zgV 2oJzngPAYvw5fSyIjwv1MJSXBVVM9FBvQprQbvkdQ8zLQBXDUok1AAGJGwHWybMeS135 P3i97WdkcPtNO3fdFqFZQ/ydaoUKND9bgZ/5F/I26Y05Dy8YA2NPAaeeTME2vtZ7Sjif /NT9nFhqKVG0A9zBzzCBlgWLcMip7mhBEc/fZM/i0q0rknGKftc9t2gOn0B1Gs6VBZzT 2+Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=jls9/giLAd/zcq9/hP3vAIxaL29XsODn0roNm7fQIng=; b=LE0+Aw9P0W0Iz05qyHi4Mq2zWVGitq8u8FPIOJ1AohTOy28YVsv4NJ+dm3Pc1fjRn8 664rXDZyjKBnZFxuY8gaS1FnBo6f2bLa9HgrjZ8ZrO3jDvWcZg9LIV/MBxKLO7VEfCIR RvGOd2pcon1Dxw8lcuP9o5lxt5PPK7QmrBBiOLJxNSlgkdeoFuK8tPyHG8SSHN3R7q1H Xjro8+xhuI8/+O+hapNcEmwlxBI2/3tD2FSctJpBwMqc5m3uVhS+bIbUjAm5i1RHdUWf CQjVmK3tYaTqOE513imC3j0+WSGPZ3ZLQDuLiU3mlkVFbyn73fuWjGLdjir4rEi/j6o6 JUXQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si2745505edr.36.2020.10.29.13.08.02; Thu, 29 Oct 2020 13:08:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbgJ2UFh (ORCPT + 99 others); Thu, 29 Oct 2020 16:05:37 -0400 Received: from mga18.intel.com ([134.134.136.126]:56816 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgJ2UFh (ORCPT ); Thu, 29 Oct 2020 16:05:37 -0400 IronPort-SDR: 3lIDUOhAjlIu+l2RhGFhiAjpjkuE4ObmUz4Fpuo4bAhM6jEBygZ6dfRCDtqyFx9ZrOjfP97noh d9hZztxaivmg== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="156277426" X-IronPort-AV: E=Sophos;i="5.77,430,1596524400"; d="scan'208";a="156277426" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 13:05:36 -0700 IronPort-SDR: qTYwAZ6BG2b7vt/5azhvXjAYOh+vwOxZJ/y7lNX2/1lNLSD/jPTfPWnHI3p3LxEf/sXkDNuEjp tcfKINEi/0Uw== X-IronPort-AV: E=Sophos;i="5.77,430,1596524400"; d="scan'208";a="469262735" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 13:05:35 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kYEBy-001UIn-Ew; Thu, 29 Oct 2020 22:06:38 +0200 Date: Mon, 26 Oct 2020 15:14:27 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH] devres: zero the memory in devm_krealloc() if needed Message-ID: <20201026131427.GF4077@smile.fi.intel.com> References: <20201026122728.8522-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026122728.8522-1-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 01:27:28PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > If we're returning the same pointer (when new size is smaller or equal > to the old size) we need to check if the user wants the memory zeroed > and memset() it manually if so. Any use case? Because to me it sounds contradictory to the whole idea of [k]realloc(). -- With Best Regards, Andy Shevchenko