Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp994315lqa; Sun, 28 Apr 2024 13:20:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2YRhopoNnE2J0r84EGFaGZxxqBXlZiFqPjsLfa6Px57CRAbyDi11vifObOsGcG3CDCHt53XxouRhP6s0r7jtj5viNPQPZN+Yf7I+0cg== X-Google-Smtp-Source: AGHT+IEJrHBuIcg2ONiobrQ0ta2Tdg+Xd+o9HDsVWYIT/UQSDiC0Z889EKBoKORVibFNIfbhwfXe X-Received: by 2002:a05:620a:3b84:b0:78e:e8ae:c15d with SMTP id ye4-20020a05620a3b8400b0078ee8aec15dmr9122036qkn.63.1714335624565; Sun, 28 Apr 2024 13:20:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714335624; cv=pass; d=google.com; s=arc-20160816; b=ekje/sog9WvJi2Azi19p5tIis3xtO3GPsm9N9H1EDy6lmMdWa1f5hPhQwTaUz9fsMa 8KOhu1jpQMiDFv4DDXS9QKss4o3T8HP7OxoZ+TWApIklgXqvVx7/6qQ+1OqUum6KHYfT LIOTVNpNo9DIHOtkvG53N6gWVPbkAFoBOWTbKXW/c2/M1yOGBsgWkseWaxHkTA6FeBmY fqAk6EGCxKjmJ8bj5o770JNiuqqnNyJ6OLf9PdIWM3tsGsxn1x/mlq1lhxpfuxoQFrVA 4asphs954CL/kW9pqjaslMhgqPm1TUWkNjy6YlnZEhtyHlqYtI+JOwNeAY0tyRFOgPDN eKiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=DVGfYkDeFehcb+pRimbLtXuka+P6h44CH3Z8Q2TQV4o=; fh=+B12jnCysxsVa2tD0Rq3pzQRYkDE6lIBzLcmcObuJrc=; b=daliBKjFhOLBXMZTuTdlwioPiQFmplbjNjfF5+1eq0yOHMKNX2qA7ooPM4eaV4F7Um Kad+CUBj8tDHDbKNCoGASMv+LEClVndzdoO/B9YUx512o/mEQKTXTd1B3g7/esPF/jqh +b2/Jd6ijjlUnqqG059g6rkmk2ErO4ld3ki52DyNLvZ4HMGbeNViMpSSUi+5oxynBb9N 5lK66ugvLORgOEWha40z3wg+jFbvctrWR5xEcNfYBxXnGQr5G27eWQT+8syfRLHQUudA G5s/iKb0b7G8+lMj/s4AiwhmG2eZZGtSRLplz4IvSZz3Kuh+PHdNvY5V1r4fvvvNmeGe he8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=QxIlbbrk; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-161562-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161562-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g20-20020a05620a13d400b00790735ee42esi17186154qkl.420.2024.04.28.13.20.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 13:20:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161562-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=QxIlbbrk; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-161562-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161562-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3F3DB1C208E1 for ; Sun, 28 Apr 2024 20:20:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9950674BE5; Sun, 28 Apr 2024 20:20:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="QxIlbbrk" Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0C146A00B for ; Sun, 28 Apr 2024 20:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714335616; cv=none; b=IzycZj1DWfWPajTWNjpDkjO4yaEEa2/GZ8UHGHxOpfToFWaGip20UP5b6BJsTL8CN/jTPCGvxR6WVE3W4IDsG0HDQt7BEFcxaawsZHq+CO7u87SamLjb3HrtUdApa3jfBJpsvA+Na3G6o8Rs2lDVPJPcYOFPZ24B9CHLuE0erLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714335616; c=relaxed/simple; bh=naiSODMjEFZTAWJMatalJfCiiGdYd7LxVoEg+do0Da4=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=Fo5uU2QJgfxdg/8AwUQacVEhJ51J10Q6MF9upBddY9mG0zJi8bMQ11nlj2lJwnZYhvC1KPYtAJZhOsp8bc83IdqYJy1no29HD6OOu/GZ4yx0L77ZG+Dz+Tl9m0E2exNbMYf+pk3OzDK6GJIuvpXZluYdUfKlSgN5vkr01MeFJvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=QxIlbbrk; arc=none smtp.client-ip=209.85.166.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-36b3738f01cso208755ab.0 for ; Sun, 28 Apr 2024 13:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714335613; x=1714940413; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=DVGfYkDeFehcb+pRimbLtXuka+P6h44CH3Z8Q2TQV4o=; b=QxIlbbrkHgVKpcHLSi6m0PObJ4km2i3FrBMFp0RdxgbiJ+3lwus/exvoFeqXAaM3NI 6Qi+e+l+WGmnXku+v0sC44jkny8wCNvUuaDsdRpiap7USDmvOxD/PDDr6eIZMR+paPt7 Rz9SC0L6gUkpLKkGDAEgG/ExdipcxRgx3IiwT3yzw14g+AMplMFnDom4J7ppaJgS02vm MKiojn8bTKmguItUE/r227U7+/Ho0Hf0IbdZsV7hALl0Eb8AGVX7VryxGojocuT4luV/ 7Grex4w7PkhfjUXKVjobsG6UyeHHkABEZT5fZmQQOTz1q5OG0UQIxz+dKwedkJFNMGzR 3XZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714335613; x=1714940413; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DVGfYkDeFehcb+pRimbLtXuka+P6h44CH3Z8Q2TQV4o=; b=Ejuj4jarErszzBo79ruBeN/j5Ym0nt+CAzyFhO6Lgf1ddMaytcWORa8Y/zSD6pEW61 7JUx2I4SoOQSZY6bkXO94XUHgqjL/ADCC7M9BvQwzE9norYblZRo4J1+X3V6RTrXWOuW +2eXPoAhnAtzO3T5jFl2lZIl37/jr8ioHI+r5Hyxo13KCFGZe6uXrdrjGAdNOHApMrQa SB11AdS4c+NamO0GBGmc8i+iqlnikBZq/zvfPnJ21cRDmP4fyDCt+jw4m4ZqNEot+p90 nJHBFju08DoELl2h3C5Xf2uvmP/80x2sViBwJ7ImLAK4rhixC7hvnIhnhdjjNJKSVo3J RIug== X-Forwarded-Encrypted: i=1; AJvYcCWIaaVmQhaOE/Ug4GiXsVGbEK7IltGojC4G2t37JoxlC32VVkFK/EsB0wwwFEjMo7pxohhenbq7I/HbU/Ijmz8eCNPJoLZtyptttnum X-Gm-Message-State: AOJu0YyeJK4pJ3qRzYEGTVY2TlW+noKysdoJoX7QERriW1eFslfchaIA W2ZNTTZ/X+mEOTbBZooVP1V70Ny3Adae0ZH7vokQdRiHVNEmA4OwsnTE4yd3OPMsf42vBnuPu4U aSg== X-Received: by 2002:a92:c5ab:0:b0:36b:2c6f:ac1f with SMTP id r11-20020a92c5ab000000b0036b2c6fac1fmr293061ilt.24.1714335613530; Sun, 28 Apr 2024 13:20:13 -0700 (PDT) Received: from [2620:0:1008:15:46db:4823:ceac:2ea3] ([2620:0:1008:15:46db:4823:ceac:2ea3]) by smtp.gmail.com with ESMTPSA id w23-20020a634757000000b00600d20da76esm11291235pgk.60.2024.04.28.13.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 13:20:12 -0700 (PDT) Date: Sun, 28 Apr 2024 13:20:12 -0700 (PDT) From: David Rientjes To: Dan Carpenter cc: Christoph Lameter , Peter Zijlstra , Pekka Enberg , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH] mm/slab: make __free(kfree) accept error pointers In-Reply-To: <285fee25-b447-47a1-9e00-3deb8f9af53e@moroto.mountain> Message-ID: <07209fd5-f6c3-293a-4968-63a11c273ed6@google.com> References: <285fee25-b447-47a1-9e00-3deb8f9af53e@moroto.mountain> 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 On Sun, 28 Apr 2024, Dan Carpenter wrote: > Currently, if an automatically freed allocation is an error pointer that > will lead to a crash. An example of this is in wm831x_gpio_dbg_show(). > > 171 char *label __free(kfree) = gpiochip_dup_line_label(chip, i); > 172 if (IS_ERR(label)) { > 173 dev_err(wm831x->dev, "Failed to duplicate label\n"); > 174 continue; > 175 } > > The auto clean up function should check for error pointers as well, > otherwise we're going to keep hitting issues like this. > > Fixes: 54da6a092431 ("locking: Introduce __cleanup() based infrastructure") > Cc: > Signed-off-by: Dan Carpenter Acked-by: David Rientjes