From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 02A5239447F for ; Thu, 26 Feb 2026 09:22:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772097773; cv=none; b=lzRv3p0ZImsU3Dxyjs1EoV5vhY3vKxSrZr7ncw4tRtaVl+M+APY7ZLrZQpMyMdckEamvT1EjzWJBY55qtq5S1vYCxzNGEniic3MkqdRoDVsGRH+ZNZurzvw317Iwf4DnxqB+otl3U9M9pHbUK5IYVdIIfYit3V2SBQsfzAoJkTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772097773; c=relaxed/simple; bh=8UXEEY78JgIJo476jNFn2ZS8ebZG6/2oNY53ZJEgYO4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tyz5xD/bdnS0gXxkBR4qSLKWIHO8So7UDI2tJz7zO/hU3fe/AdYkrseqSIbXSYcprpsIEV+Bag/2sxalzJ7bGD0FN/bzm6/r2ZCTej47tXbK0LjCohkB21XL1WJ2v4w3VxZ2/CafylF32TZtY/M/nGr+2/kqueUR8hVIMqaZSf4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xd5G+ZeI; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xd5G+ZeI" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43991cc3155so613184f8f.0 for ; Thu, 26 Feb 2026 01:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772097768; x=1772702568; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3Fi/8raflhbrprvHiDe2P6OVjgFKHTkfZNPmoq1Ca/k=; b=xd5G+ZeICfCxedsy6gsAiDxNpOcxL+xqSxryfu55OWSCdmL6bO3mV32PMO5PHriuVt 8xNOV35qrXYOGszokOk6wzTZvRw3yoNKg+MLi4dLeNKuYQy4mEOkUTBUAaULSjTzZem9 ZtiQSXEYfXIoGm6DIhGY/VWJ1TPxJY/Q9XFix6+HA/P01WfeqKhOvYSCj+oNs4Hx0s2V AjLdYsRLn/HbCbzZ2kL8+OTfKT0GFrmaKKnrKj70eOR9wnnZpxroHyWm0+vgD2YBgU/a X1oV7NR85AzJ9+jP7JVpF+yUf+lmVB7NLfU5aRtEG91XSAmD9lCbeeqqT41YyQkNqVUr oy8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772097768; x=1772702568; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Fi/8raflhbrprvHiDe2P6OVjgFKHTkfZNPmoq1Ca/k=; b=ciJFo3D57wLK10q2Bn/kumIe/fPk+XB3d1yWGWThRIL3DOkp13TcRssjRGD6Htl9ig 0Yv0QR39/v1XPs1YVMfKKD0XUayQD62JE4VEeNlKrNFcckk27/ezs+pWK9oDoFQhBhmp qf28escYspftQeOY2K5D3q5WdyB+GNJ4XnJOfamBZP+jXOT3d2/duBgi5B/SV52YhVbj C9sIs6S++UyAbXzdEIX2gTy8WN2VYAGstTke0Vnw5MTId2eyHV4XLwRuiTxN92knikkB cGcvaZOPBJ54ayZbY41IvCp8ufRoa2ijO4H7IZT5DMnqf1ljGj8HEkvAXcaLBaJhOfgv Uw2Q== X-Forwarded-Encrypted: i=1; AJvYcCWh0tarvKhzLgP76luTILyH59PqGbYQo2iY5cH+sSeLC6BPv2vR7LBuWAX3mqHiMh2yEIiQ3hfwkHTQ2mg=@vger.kernel.org X-Gm-Message-State: AOJu0YwGlsMtVseqOgLVdm0JDeute5pxvyDPUZdulu/wU5UOdJkw5emt YPjGpMXUa7nmoyjaZg0YScrLdWp6HqPLOOIWunNRpo0ckNJ+C83Jtb8zyF5VQcEn9Hw= X-Gm-Gg: ATEYQzyKg2w/3vMsu8kk1IhW3GWLnVNCY2qUVcKywfb2P7Yfa51+7b8O5xUDvIPXq/T eudFAmRdA3FpmqMY8WSSjKSvqsE84hLCo/L/GNYZvRKDoUeucXcrQ7B/IDW7QyWQJoXkdooxXg0 yrwFiET/zxZtJE4noBJ0ls6b3OPssY3QXLtYEDd48xVe/aRZjqOop5LxRkYbAzAKsyxSvnu5qPe If4IdTVBknCtht0pycdx4RYxJRynh5klwueZ9gMKCH+/Dq82aIUNb/zrrDxHxrafBkMjZ/yQY89 Dn1lEIwkZ5BH6YYrv41NIuLxzT4rjsfG6h7py7pRiy60vRpnrEkdy0WRqaG6wnjsSrKKJQSEaQq JEvNyswWLtAAkmh+3MGOvBiLzyizxst2CZ9/5+sx4ny5g1iSG4qBAtDxXNCZP1EH3uY+eUVPRvB 8xFw7CfH6FVREbbHgCmyux0CITfMat X-Received: by 2002:a05:600c:5250:b0:483:9139:4c1d with SMTP id 5b1f17b1804b1-483c3db85b0mr23915235e9.14.1772097767976; Thu, 26 Feb 2026 01:22:47 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439934cc51csm8305010f8f.3.2026.02.26.01.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 01:22:47 -0800 (PST) Date: Thu, 26 Feb 2026 12:22:44 +0300 From: Dan Carpenter To: Zeeshan Ahmad Cc: Sridhar Samudrala , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman Subject: Re: [PATCH net v3] net: core: failover: fix NULL pointer dereference in failover_slave_register() Message-ID: References: <20260226085601.11343-1-zeeshanahmad022019@gmail.com> 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: <20260226085601.11343-1-zeeshanahmad022019@gmail.com> On Thu, Feb 26, 2026 at 01:56:01PM +0500, Zeeshan Ahmad wrote: > Smatch warns that 'fops' is dereferenced without a NULL check. > While other callbacks in this function properly check 'fops', the > rx_handler registration does not. > > Consolidate the NULL check for 'fops' at the beginning of the function, > before it is first used in slave_pre_register(). This ensures 'fops' is > valid for the entire function scope and allows the removal of redundant > NULL checks later in the function, as suggested by Dan Carpenter. > > Fixes: 30c8bd5aa8b2 ("net: Introduce generic failover module") > Signed-off-by: Zeeshan Ahmad > --- > v3: > - Move the fops NULL check to the top of the function before any > dereferences occur and remove subsequent redundant NULL checks, > as suggested by Dan Carpenter. Thanks! Reviewed-by: Dan Carpenter regards, dan carpenter