From mboxrd@z Thu Jan 1 00:00:00 1970 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 A518B3E868E for ; Tue, 17 Mar 2026 14:42:50 +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=1773758570; cv=none; b=G+WAVLP4gmHXuM35dP1Fe6MvYxGaCDqybIJLT148Cs46aLEH5w339D76yLLGQrZC6qstPqfl8jUOhdxn7hHH0++9eliTThQ9AEfHA1pCiD6G4OyHozWVhYLmJG7ROvTBFavgB9RoFdYGaxln0dC6ooUN6miG3PVOZqVdTAfqYUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773758570; c=relaxed/simple; bh=c4k9A34hNjsShg4DQ5ZPsNaFn/OfLHXaMgA4MkBVVc4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iSaQ8brnlpoGbtjYB2/0iQySkPzihFjuW2tfeSN0EhR90t/H2gLFKgLSqqfGmd6yPjJYSJN/mXbzt7egAQ+F2SEjRDbPd2ozm6LqaPP428VLq/afD74c2/ehVqZctPNTlp/mA0JKcvw/0MvCuXVvEiQ/egN+/EwBjBljD1YqH5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zKMCCszK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zKMCCszK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 813F4C4CEF7; Tue, 17 Mar 2026 14:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773758570; bh=c4k9A34hNjsShg4DQ5ZPsNaFn/OfLHXaMgA4MkBVVc4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zKMCCszKduBYDHfR8eLI1v9PZjTvjyXeRTDxCAs2L5FrNta91gGTNhZRFHP6dNlGZ zqr/EUZrK+BgxgR7Pe+DhTsP1pRcXYrJ0VGV05+KjWGDPwTKHED4dPvHaJfl/ZK2lg zozQfqF7QKjAoKNg+lllym3Kw8WMvS+DCg6YJX+Y= Date: Tue, 17 Mar 2026 15:42:44 +0100 From: Greg Kroah-Hartman To: Krzysztof Kozlowski Cc: Peter Rosin , linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] mux: mmio: Zero the allocated memory Message-ID: <2026031721-fable-creative-74fb@gregkh> References: <20260317124826.233006-2-krzysztof.kozlowski@oss.qualcomm.com> <2026031710-implicit-hungrily-3b47@gregkh> <4e93db73-20d2-436c-b9e4-4b41e5c237fa@oss.qualcomm.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: <4e93db73-20d2-436c-b9e4-4b41e5c237fa@oss.qualcomm.com> On Tue, Mar 17, 2026 at 03:39:41PM +0100, Krzysztof Kozlowski wrote: > On 17/03/2026 14:33, Greg Kroah-Hartman wrote: > > On Tue, Mar 17, 2026 at 01:48:27PM +0100, Krzysztof Kozlowski wrote: > >> Zero the allocated memory in probe() for fields and states for increased > >> code safety and to match expected Linux coding style. > > > > What "style"? I'm all for zeroing out memory to start with, but as this > > That style ^^^ that we expect zero'ed memory :). > > Also, memory-allocation.rst says: > > "And, to be on the safe side it's best to use routines that set memory > to zero, like kzalloc()." > > So the style/preference is actually documented. > > > has lived for so long without this, are you sure it's still needed? Are > > there uninitialized fields in here that we are now properly > > initializing? > > Yes. The second allocation is for "hardware_states" which does not > receive initialization in the probe, but first assignment is in > suspend() callback. > > Zeroing the first allocation for "fields" is rather style or convention, > because the probe assigns it further in the probe. However if the driver > exists probe via error path, these bits would remain random heap data, > which most likely does not matter. > > I can expand commit msg with above. A changed changelog text would be great, thanks. And who is supposed to take this, me? thanks, greg k-h