Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1783253rdb; Sun, 4 Feb 2024 00:54:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEn9HvgECjPpNuBUruNQiaD330/UmWOhs/3FOhEeUruWNRUwWzRt44ewamsZ80iJZcR1PCN X-Received: by 2002:a17:906:c107:b0:a37:6897:f947 with SMTP id do7-20020a170906c10700b00a376897f947mr2968152ejc.47.1707036890223; Sun, 04 Feb 2024 00:54:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707036890; cv=pass; d=google.com; s=arc-20160816; b=O7j/MR8n8tyLKZDYOeuxiGtfNoadgyKTy1e/2Ua/ebwU6YiiCRwPk6lwIJEmACXhqi sFXG0yst8sy8Uz7nuEP/do2a6SgIzqXiTLCO2AB3UN9Vs1ZOpHorqKup8SVD0igXhbM9 6wiqsbINNOrm8qbk/+2DM/Xa445psYz8R5iPe+FNXzlePGc65YLkMmYRRIxR+cFq3+HM r2xgfBUjd8DV6lvtP/bbfL7/pPEUwSu0EvmZ8G+Wen4e8MdAfHqoMyOs5sZvwCn50Bmb MyMKfsVJdbvsi0R9LFYklSKtDpAzR2LMvr7BpCEnyHQqu/6dDdbzFP0sd+9Vi0TKZcMu krjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-filter; bh=bdcbSUNCCZm49I2M6R9zeavTDLhu5z/DztFvKkbGu40=; fh=N0/SglPC9nxfk6xZzirr/cwvy2xoiHKPeh4bD31OxbE=; b=jxnaBkinFDcdjBEQNZvQktBEoytP9N3o8mL1kBMErv6Uajp/sYGXkKHcobCV22Knmy /iQVlzjZnRYVrSdKUZK/sjYDU0NWrIT4gRleaw/LMpoUxt4SiNuxvCjySpmr0XZISuPj KrEBwRxE0ai51V5/HByHYgR6/nYZjO+DMOUmKq73Zq7aWb33ynjOfP2hpMoXWResOjUt DYtt/8UIh31wxHDn4MMqdsMjNXCV82hpWvgpZcgwGmLXofVSllFJmyl/o11rf8lSHDzv +G+wO4um42OKZEoQVdBHWRWnMGK3kAv5KNlCTWo03wLP4KxfbdDbItSYfWTxr8S0VgSj mCtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=RehFBpwb; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-51536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru X-Forwarded-Encrypted: i=1; AJvYcCWNVi4+Z3RBF/rJoT26rU08P0zOx2qudel1WylFlLb83lsnnoDKtb6BcAX35VVAr3g7ISvJB31VcKexcv5vxyuucJpKRMvbhgguH4IJ3Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jx22-20020a170906ca5600b00a35be3ed835si2703260ejb.58.2024.02.04.00.54.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 00:54:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=RehFBpwb; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-51536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru 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 C8BEB1F24744 for ; Sun, 4 Feb 2024 08:54:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D981171A6; Sun, 4 Feb 2024 08:54:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="RehFBpwb" Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2D83171A2; Sun, 4 Feb 2024 08:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707036881; cv=none; b=XJySIKNANYWX5xnpevNJ1JDQXX+tCwJnGoWBaJpvBRZUtkC2pQkt85+8mv0sWDOvXXCEYIxrPKKx4WxdETHZhdmgvAAxJXxN6X0PXm82DkZDA5/13X478fhZgSI4cemt3mRtgYkoJUXA7e9+OZQ/bhfl3rPYq9kAuHTrA7wA7iA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707036881; c=relaxed/simple; bh=DjliCUFmLoTwtSCb38rk4kFcnS91lawm9czL/JzRkDA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S9TjBAl4xOO/4D9636icCLNKx4BNDHaRTPNEvmFH3/4Sh5rXgpzVzf3i1HiRQib+uwm8yOp1q5KpR5BMVkzQn4O3BvTjHMOVEIDWolyVIAxZiYMdR+lN52ba25QbOH8BsmSo7Zj4dKf74gE8pDqeVtuDwf+A4R5ZI3hiAgYn6Sg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=RehFBpwb; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Received: from localhost (unknown [46.242.8.170]) by mail.ispras.ru (Postfix) with ESMTPSA id 75BEE40F1DD5; Sun, 4 Feb 2024 08:54:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 75BEE40F1DD5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1707036873; bh=bdcbSUNCCZm49I2M6R9zeavTDLhu5z/DztFvKkbGu40=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RehFBpwbAY+c6D3NP+7uYvFFOVC9FgQQ8c1IitjShCy9UP0vVPBBj+HOQ5sBlEYzu nEV+R3mBnYegPhm+HDwMTC/dY1RaT2YaSltRjD2uiLIomQ/dpZTM1E0PwKtpt0UDKE MKd8z3fGQfV1Due4aIPLu0o/OdLNz/rKZbgxEq5M= Date: Sun, 4 Feb 2024 11:54:33 +0300 From: Fedor Pchelkin To: Wolfram Sang , Rand Deeb Cc: Tali Perry , lvc-project@linuxtesting.org, voskresenski.stanislav@confident.ru, Benjamin Fair , Avi Fishman , Patrick Venture , openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Nancy Yuen , linux-i2c@vger.kernel.org, deeb.rand@confident.ru, Tomer Maimon Subject: Re: Re: Re: [lvc-project] [PATCH] i2c: Fix NULL pointer dereference in npcm_i2c_reg_slave Message-ID: References: <20240109145121.8850-1-rand.sec96@gmail.com> <111837c6-6c60-4bd4-9e66-1c652a43f3ae-pchelkin@ispras.ru> 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: On 24/02/03 09:44PM, Wolfram Sang wrote: > > > If I'm not missing something, npcm_i2c_reg_slave() is called via a > > function pointer ->reg_slave here [1]. And seems `client` can't be NULL > > there. Other drivers implementing ->reg_slave function don't check its > > argument. > > Correct, we trust ourselves here. > > > Maybe we should just drop `if (!bus->slave)` check? > > Yes. > Okay, thanks for confirmation. Rand, would you like to prepare the patch, please?