Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1067705lqp; Fri, 22 Mar 2024 04:54:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwh/y9UUgphA0avP8fA0VagU9lj15ZEOmgHEQmpX/q279vaeG5Ei4QeKKHlKjJeGn1B7gj+zrswEWWMH00ZMNjgz794A8YoLuWrGO+AA== X-Google-Smtp-Source: AGHT+IEHRc0G+8YF+YPbp8lQcz5jpE5sGx9LEus1tVnC/p7wyqiPT74QmLqEI7tTkt3wDIrhFrao X-Received: by 2002:a17:906:4ed3:b0:a47:3775:2a41 with SMTP id i19-20020a1709064ed300b00a4737752a41mr500042ejv.2.1711108474222; Fri, 22 Mar 2024 04:54:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711108474; cv=pass; d=google.com; s=arc-20160816; b=ZoKN8Mx6hVDyaYD83UJvfW9BWqjMKhzArW3622fWhnar095p9DDKlW3jNWt14kuc1E i64Gh9zMwCiawn0vXKH2kqlZSklUjUQAhw7laeNIhzFZYmCUO2W8AwtkFRBKC9cQbMiy 55LxEWcyIiecfJ2TyWeX0na3igwE6z6cvRMRdHZx4Dt7NwhxfD761LCsR7ZcRP02LQ+V En0iB0UHXc4ZNk6EyTZQvGvAIo/orP0RUP8/qx/1qXnUouVoiDmUvHGgpphyRcYR3nwx gR8tHoxFXQDNMrCTSOxnL7udmD6cnRPDXu5P+GQxZxsSLTOgYUlixVH5z1LAFM7mZ7KM /p/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sugrI04a69D7TsptgUFH0TrJAHa5oTy/e7UovPooNCg=; fh=KCBfZCzRNOgbdb56A5njh+ictPAJV1ZVus0FzI5UW3g=; b=qBV2EKAnz+f9t4hcoCEKRda3iToZTYyAbG686ZGy7+yjSC3/M8j2hE77jbil1F+qH6 INUVBKpvx8nVcrv7ip4WWWHLzDW7cd2T+Xy9saVgbfBfGOSfuS+6HYQmWhw0igeEhMz5 OXGSeC4AVWnv9rTRGYikUukzLSriUgtiQqkPjH4DKnTP+S64x+fz2/rnBhdu2Od5f32a W9cdJv4gVeUwxxZQ0dCb5p/Vq0dqCRWC8Qjf4u6u3buiUUJLiDMJPENF6KD94kf0ZkI6 7xjc/+vk7EgjZswxVTIQ2I9ACYTocJ3xn7HMl4UXduGdAFtImO6FAscj0j1sZVWrUWcF W3NQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c6EiJl7m; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-111386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q25-20020a1709066b1900b00a46620a5593si850339ejr.153.2024.03.22.04.54.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 04:54:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c6EiJl7m; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-111386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id EE3A91F24AD2 for ; Fri, 22 Mar 2024 11:54:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14C793FB88; Fri, 22 Mar 2024 11:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c6EiJl7m" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.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 D2DA23FB07; Fri, 22 Mar 2024 11:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711108467; cv=none; b=LgqTqq0Xd9Isdn4i93Dh8ph4Pv8/VTh/kMJiDTvC8ewF2uriUdTTJhuf2sTGtXOY4nJ8MERAY+pVVkishwiDgTyz1yqz1uTps+A11Rcg2SDPtre/TRI6lI16NF49kLRDJfZOVSW6a1jzfd2yDQ0FTp6UlhyGD1w2Tfvw+9tCEtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711108467; c=relaxed/simple; bh=cl4xjErbVI23OC6w9YYx1Y9I9UVaJ3wKtPzhlKhvlaQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oexyyT2SBsKwfSvwAn/ELFjAEJ9vyAfxoGlq1T2iIzF2oI1M8t42selBr0mhCj1zrG0ccs83EttUMJWru4HXnUsObugwSfHsDDf75dsEwStqBHK0aPyNqRnlA+dPqf7RA4xaQY/ABEGmLq99K0MlH7Z4m6puqYhdeJhROM0gtYY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c6EiJl7m; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1dca3951ad9so12803295ad.3; Fri, 22 Mar 2024 04:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711108465; x=1711713265; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=sugrI04a69D7TsptgUFH0TrJAHa5oTy/e7UovPooNCg=; b=c6EiJl7mU+JkDh6n3wQSIJxcydAMhQ6+uHiYZjR2iUsyXYFSIjemFxd0awfuGmNgKn XHwpDdwmrY2hshxMqvnbNrfoyDHBvzD26Ss2qmIsPcmMCBD2210pb2JE4SZHwG7Xjhdw nyLFwUe+m3PCz9RCm0ad1FBCi/MF2UOgx2lMtCaIMoMW9pQmIa31//V+/aRQQzKPFhyJ bwYDIvvkQYB8o//7AHGkq02NZd52zeHs4NF6DbyzmcyJ4BRv1F2G1xvMZDr1wBbPIHhQ 3Nl+T8rAILy9OSG5C+0COGpuPSuwnYnXqtW9YuK0x5I/bekKNTYiGzxR0ejqBZoTvIHD sVcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711108465; x=1711713265; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sugrI04a69D7TsptgUFH0TrJAHa5oTy/e7UovPooNCg=; b=nkbEjUhstLZHwgut3ZIA0gy5mbtCO4rMB+1KKh9WyMxXBvWHDT5rJWs6FC8yueGWzj 1xCq/nsfzFAKzVdBKZwJaP+nB/KWUL3nP1l7f3Y3qT4q1UYmLEvsz+TunJZHKdDygbp3 TqdduwMJonIqjfg5T6cQSqMk7XwKHShMFBNTJh7z5vZ3d3Nfc03JhMYgNnpSTh24np0r OrEARFmUenmiqRbKPasXytN0ZzOL+IWvV/slqqSBJSNLT9th/q23gXkhTK6YKQ4o1ScK 6rfxm9N9uLKOzT6jvAMJ8k24zjFgW4sk2vfXgegOBXWeUy38TRczuPx29+ECzxe0ugpZ xKgw== X-Forwarded-Encrypted: i=1; AJvYcCWYhAt66ZNSHq4uZGwH02Y546mIS5D74Yul6cRGraiuWe0dthhTN7rNrXNSbM44DKSMRucbrtLerE/mHf8+oJwCDfMO+gTkJVQXYq8xWr6CsQ7s96Z+nqITpPMQbRGZvHRn1NKwOP+F1sRjKpUCBg+qLufd8h44tOa9l6gsjpi7Eg== X-Gm-Message-State: AOJu0YzbsrRkZdez14Cxnh9qWWL3inyYZUNnxMqeaiEePfH5cXB6u04P mN2dChIU/5PmuZHam0+NsqkNh4zDR8xdLpa91vdKBJK1v2U2aIQF X-Received: by 2002:a17:902:f7d1:b0:1e0:18b1:d0a2 with SMTP id h17-20020a170902f7d100b001e018b1d0a2mr2184720plw.40.1711108464936; Fri, 22 Mar 2024 04:54:24 -0700 (PDT) Received: from rigel (110-175-159-48.tpgi.com.au. [110.175.159.48]) by smtp.gmail.com with ESMTPSA id l15-20020a170903244f00b001dd98195371sm1686451pls.181.2024.03.22.04.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 04:54:24 -0700 (PDT) Date: Fri, 22 Mar 2024 19:54:19 +0800 From: Kent Gibson To: Dan Carpenter Cc: Bartosz Golaszewski , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Dobriyan , Bartosz Golaszewski , stable@vger.kernel.org, Stefan Wahren Subject: Re: [PATCH] gpio: cdev: sanitize the label before requesting the interrupt Message-ID: <20240322115419.GA31273@rigel> References: <20240320125945.16985-1-brgl@bgdev.pl> <20240322013034.GA4572@rigel> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Mar 22, 2024 at 12:31:36PM +0300, Dan Carpenter wrote: > On Fri, Mar 22, 2024 at 08:46:50AM +0100, Bartosz Golaszewski wrote: > > On Fri, Mar 22, 2024 at 2:30 AM Kent Gibson wrote: > > > > > > On Wed, Mar 20, 2024 at 01:59:44PM +0100, Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > > > > > Let's replace all "/" with "-". > > > > > > > > > > I actually prefer the ":" you originally suggested, as it more clearly > > > indicates a tier separation, whereas a hyphen is commonly used for > > > multi-word names. And as the hyphen is more commonly used the sanitized > > > name is more likely to conflict. > > > > > > > Sounds good, will do. > > > > > > > > + label = make_irq_label(le->label); > > > > + if (!label) > > > > + goto out_free_le; > > > > + > > > > > > Need to set ret = -ENOMEM before the goto, else you will return 0. > > > > > > > Eek, right, thanks. > > Smatch has a warning about this, btw. > drivers/gpio/gpiolib-cdev.c:2221 lineevent_create() warn: missing error code 'ret' > And that triggered a "what the hell does that mean" warning in my wetware error parser ;-). That could be better worded - it isn't "missing", it hasn't been appropriately set. So maybe "unset error code"? > The other warning here is: > drivers/gpio/gpiolib-cdev.c:2269 lineevent_create() warn: 'irq' from request_threaded_irq() not released on lines: 2258. > Looks like a false positive to me - as per the comment in the code, that path (2258) results in lineevent_release() being called and that releases the irq. Cheers, Kent.