Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp60150rdb; Thu, 1 Feb 2024 01:56:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEe1d6iiJIT9eFLzTUF/gwnBfpuCqMB1HaZlIOULGcV0vtar8yxGyZ3CRwGBTNx5ELcUDdl X-Received: by 2002:a05:6870:9a0b:b0:218:f48d:4d9d with SMTP id fo11-20020a0568709a0b00b00218f48d4d9dmr696752oab.30.1706781376600; Thu, 01 Feb 2024 01:56:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706781376; cv=pass; d=google.com; s=arc-20160816; b=G7eNOgVoIi67JZjuqdAxMEV4KGke9RZl/eTnn3q8jb0Rb2+WYDpzjajTXau+ENWfOA 1MMlWnwJqOTZtIXoOd29d7bEpYRsDdu6S9Cx7qM6ZetBzFtMJ1CI92NjXhl3/NGk06m4 515rKzZcv8F+7GEbuOlKri8BOBtWt08x/fxXB6FtSDgwTxVLToUo9vzUPMwPG6I+tyIW mePWhCi+i5d8ODgzwsalZZYByA2aQerWG7k/1E92SrUz4BkLF94PWrypes80D9fO9PHD b/8zccwxlY5NHe02R1700oS72g6lF4vYq2CspU0FNONrouveDOTGaZ9obWM08BvCEFOL y9Pw== 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=HdteoZiw+5/OmUsXUra5SDm6dDlm4xvo64P88Qf5vXk=; fh=JXMnhsWAS1l9kb9DdBN3axF6XlRzaabU3YTNUXOlbfU=; b=UjcqCC6BP7fIf7Vr/CwbBtRYAMSpmWgAb58MROesbtHS0+CUUhhBsTbWb548EmcsL0 8Bc+ALnfV1tCDAkzvAtr3fWAG2BqvdCsmRknXk6c13Xp4QwQoiFsmSm/+Okakoe/O2bj w18ClCfnB086LlAoT3GZLTfnCJA8LQeatMwhyduxsOTOZfA8pOgAhX+DL8aCQdUDGP8F bZlbYTWXob0yVbWvMeZ1j3GzXDb55spNVK23SGnNO9FxF4wHyxELTKOxOp7C6A37C0Ew EIUb+kJccey9/12eSQJ+c5/PPZmTnyWqO15B4STOs0hcmVYgFL+9xfjZE022+NSe3w7u bBUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udU+noJs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47916-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47916-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCV28jVr96E5QtNTBT5Kb8Qti5lxcGoZ1E2gLYNTNcstAk5KmSnI/AZ/qCcVM/KKUaKCnvVT4r3gtJhhYOmPcKp70FrMhZ/1jAQ9RrFyIg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e17-20020a637451000000b005dbee5249fcsi399137pgn.688.2024.02.01.01.56.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:56:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47916-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udU+noJs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47916-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47916-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 21012290851 for ; Thu, 1 Feb 2024 09:55:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E21D1420A6; Thu, 1 Feb 2024 09:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="udU+noJs" 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 BA07B4D9F1; Thu, 1 Feb 2024 09:55: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=1706781350; cv=none; b=aW4IJoTqVhJ9XdOPSanFGcj/l0kKX97al8zM6KiWRnH+rRoKBzh+mgb5sn96eZFeq5FGuUpjkqez7OdPYZlA5arIAAI+TzuCAns3s/EwRs4KsuTt3uGvT5h3iiRTZXQYQCvv0Roc6MimaTtg0W/YmzCcaiWnw0jTA5xZ7XIiNM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706781350; c=relaxed/simple; bh=vJ1BkR2GfCGMDVdnAPNTubCrwkh1sWpvq2C/V4sxRlw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ftDsPLa7x1iaAVBCKqoOGyHGoDZlfa0Xaq0cq0Flvvn4VTOc4ghHwhPeYztN7Sa/ZZpf8nSAl3ND56Com3PnuM3RFBNQ8maJnKexYCUN2LjdNlWlgRRagNYfO9l12PRYwbC2RmRa7Bttoi8uAmQHL9gSfh2PSMoWaPrDTPjcuwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=udU+noJs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AD99C43394; Thu, 1 Feb 2024 09:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706781350; bh=vJ1BkR2GfCGMDVdnAPNTubCrwkh1sWpvq2C/V4sxRlw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=udU+noJs3w5E5ck/mdeMWLhTqvrzTumyFgYCEg16WRSyWn0uAvjMDBnR+Cf2YT19f Oky6gZw+fSKadzmpuH2b704oVqsnIkl+eGZVYWkw9gz4CZZhe8aEU4Ozo6a2uK5XEI +5FyIOFhEyX3BKdfkHi9FiQwWdstJCtJ5dCD76mYcl63T+Jq7rK53AlYEqQGKhGOn2 4q3ScG3RDRZHOIg8isVdYgToSQMSTyiafCADkCrm9Pk5/NuvZrg2VNNtBA6DyZin28 u7ZOsNX5BTN/QidK6xJ4VVS91u/naiOUjvw7FTexORi8n3cFkAst70UZhAkiQyZJW+ qOBQpuhQ4X1wg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rVTnT-0000000069s-1XJ5; Thu, 01 Feb 2024 10:55:52 +0100 Date: Thu, 1 Feb 2024 10:55:51 +0100 From: Johan Hovold To: Doug Anderson Cc: Johan Hovold , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] HID: i2c-hid-of: fix NULL-deref on failed power up Message-ID: References: <20240126170901.893-1-johan+linaro@kernel.org> 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, Jan 26, 2024 at 09:47:23AM -0800, Doug Anderson wrote: > On Fri, Jan 26, 2024 at 9:10 AM Johan Hovold wrote: > > A while back the I2C HID implementation was split in an ACPI and OF > > part, but the new OF driver never initialises the client pointer which > > is dereferenced on power-up failures. > Good catch and thanks for the fix. FWIW, I'd be OK w/ > > Reviewed-by: Douglas Anderson > > That being said, I'd be even happier if you simply removed the > "client" from the structure and removed the error printout. > regulator_bulk_enable() already prints error messages when a failure > happens and thus the error printout is redundant and wastes space. True, but that error message does not include the device that tried to use the regulator. I actually hit this when adding dev_dbg() to the function in question. For such cases, it's also convenient to have struct device easily accessible so I think it should be ok to just leave this pointer in. Johan