From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) (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 8508B370D77 for ; Wed, 12 Aug 2026 02:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786503313; cv=none; b=k1x7XHfG69Ei5boRFd7hmcH2md0l+Tmnfh0lj6ul8sEDJc+gKz/qLWLmcWVHynBQs3YNwScvNQ5eGIy81R9gCMN2bVHVI1PcOUPJK5ykokIhqUbbHm0gXbZQGFGin0evQUOOFjzLOzvdEDjuNTKfgtuuXjvEuuD7liUzEw8gVh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786503313; c=relaxed/simple; bh=iKRg+zuorKbDV7w5OOW0w+XqugYMHVG147rTIKlrxXE=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=A47mMh8HUJd7cVnINYFNZgGLJH4L/XcQdzCaS3XgT5LQ6a5xQmbucmzj1ogJJMgtHVGXbtT61TvF4b8qOh1SSLjD+0Tl04biq0XPHa3r+5KA+qdszfAMljqmhFhgio3z4/mOP0jjB5wUo8YTkRm66Q2eaQ6G3oV1XdAM99EQNv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf14.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1E7F6A02ED; Wed, 12 Aug 2026 02:55:11 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf14.hostedemail.com (Postfix) with ESMTPA id A366033; Wed, 12 Aug 2026 02:55:08 +0000 (UTC) Message-ID: <2c012201fdb725852c8b00bed1eb135762f47981.camel@perches.com> Subject: Re: [PATCH] checkpatch: Add devres_alloc() to allocation functions From: Joe Perches To: phucduc.bui@gmail.com, Andy Whitcroft , linux-kernel@vger.kernel.org Date: Tue, 11 Aug 2026 19:55:06 -0700 In-Reply-To: <20260812024304.9350-1-phucduc.bui@gmail.com> References: <20260812024304.9350-1-phucduc.bui@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: A366033 X-Stat-Signature: 15jbqwpxoid5qspur5rso4yqp5wy19wg X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+IWZrIaaXUDfmdOgjPNp5oNwdFIefpBi4= X-HE-Tag: 1786503308-378713 X-HE-Meta: U2FsdGVkX18iH99/H/i6w6D69+GobjBiFJX/If4c8t5B8CnKRb8fUkJ/3KUwuUDGO+yxV/41MBsk5MZ2YZ0W9P1ZhbiIxmSlkylP4BFWXj9qwCsC37CAcY5+C4smf7WE0TIqjR/EtsnfgC+NBwDXi6wqCr6i/g1KP7bbXqcUepN3iYKAzRPucWH5t2JuxIjkkaXIvg/XDRgzEbq6/d/sCusBrfelN3D7KglI91UDhh5jMbaXXpt2YYDsssGCUFV167q8frGgjBenUfaWIigcq/apQoYUQ25dCtcbyde3j8Fs7V0LYCjKdBKNqW7rKirx/ahrkDMenUwd6tkNgpAOV3qMi9JipeFp On Wed, 2026-08-12 at 09:43 +0700, phucduc.bui@gmail.com wrote: > Add devres_alloc() to $allocFunctions so checkpatch.pl can detect > unnecessary out-of-memory messages following a failed allocation. OK, are you also updating the 2 existing instances where there is an OOM message? ----------- drivers/thermal/thermal_hwmon.c: ptr =3D devres_alloc(devm_thermal_h= wmon_release, sizeof(*ptr), drivers/thermal/thermal_hwmon.c- GFP_KERNEL); drivers/thermal/thermal_hwmon.c- if (!ptr) { drivers/thermal/thermal_hwmon.c- dev_warn(dev, "Failed to al= locate device resource data\n"); drivers/thermal/thermal_hwmon.c- return -ENOMEM; drivers/thermal/thermal_hwmon.c- } ----------- drivers/usb/phy/phy.c: ptr =3D devres_alloc(devm_usb_phy_release2, sizeof(= *ptr), GFP_KERNEL); drivers/usb/phy/phy.c- if (!ptr) { drivers/usb/phy/phy.c- dev_dbg(dev, "failed to allocate memory for= devres\n"); drivers/usb/phy/phy.c- goto err0; drivers/usb/phy/phy.c- } ----------- What about devres_alloc_node? (there aren't any OOM messages) > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -644,7 +644,8 @@ our $allocFunctions =3D qr{(?x: > kmemdup(?:_nul)?) | > (?:\w+)?alloc_skb(?:_ip_align)? | > # dev_alloc_skb/netdev_alloc_skb, et al > - dma_alloc_coherent > + dma_alloc_coherent | > + devres_alloc > )}; > =20 > our $signature_tags =3D qr{(?xi: