Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C596C38142 for ; Tue, 31 Jan 2023 17:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232031AbjAaRXq (ORCPT ); Tue, 31 Jan 2023 12:23:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232059AbjAaRXn (ORCPT ); Tue, 31 Jan 2023 12:23:43 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C3F746BC for ; Tue, 31 Jan 2023 09:23:42 -0800 (PST) Received: from martin by viti.kaiser.cx with local (Exim 4.89) (envelope-from ) id 1pMuM4-0000tx-Q3; Tue, 31 Jan 2023 18:23:36 +0100 Date: Tue, 31 Jan 2023 18:23:36 +0100 From: Martin Kaiser To: Dan Carpenter Cc: Greg Kroah-Hartman , Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: r8188eu: fix NULL check for rcu pointer Message-ID: <20230131172336.smmc7dfvk54zftw6@viti.kaiser.cx> References: <20230131090057.241779-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: Martin Kaiser Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Dan and all, Thus wrote Dan Carpenter (error27@gmail.com): > This patch is fine but it's a clean up and not a fix. The original code > doesn't dereference "br_port". I guess the new code is faster and > especially if you have lockdep enabled, so maybe in that sense it is a > fix. ok, I see. The br_port pointer may no longer be valid after rcu_unlock but we can still check it for NULL at that time without dereferencing it. Thanks for the clarification, Martin