Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp660281pxb; Tue, 2 Feb 2021 14:42:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrxvmiuS0GZir00CUAByACLMFpRa3r8Cbw2gA/8Eo5AvPJan/+fIejYZjr/osFzmLQwN/a X-Received: by 2002:a17:907:20a7:: with SMTP id pw7mr197621ejb.283.1612305721886; Tue, 02 Feb 2021 14:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612305721; cv=none; d=google.com; s=arc-20160816; b=yvzvc5okHDmMzVwCN3bu9LexGnebTvbEMCSRRGU0T62yLyJXv86lQ41pVJhrDFkYpt LkbF2ruDmojrjrox/8ghEZBHCfxT5t3yEDgoIp+CT6Fdk6RSDhAP80M9hDwGKTh0vxtX YZEhIxvD2Q6oXy1k2X/dw2bZfW48xy/YmF4NHtDVgOJgusGi7xBHWZEb5A3nVZSSkvCB zDWtBFEVzgqDgNaMmsjFvTpklodyu7EZwW3OB2ASlddrqPtm/E0rmPi3+R23p95N3r30 i6ISQi7Cb51T4MNdhCpYOv01DAdgbL3et/OfS65Em5EDOW8kvtCcOTJRDKeAJUzy84nE OgIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=uzNx3lSRoU1rJ/5S2TuNmjHJQMVoPfyEerwrLD2odAo=; b=KHkbf9luQB/Nuv6Kd7WjE1nrWrFAjACqqkjI+hR7hjs6rAWc2DignnLrnW657KylZM aFJCyF4tPahjgiG1R1pyKxuImeHPYqhE9QBZtFNcTjzO5if61qKbj65dz9W2YZL33Bj3 /tH0FlbFbdmM2gZhT3cbkELsI1fKlouFuxcr3qZkg7paO1bMP9mv3swC8NLEpY8NXKWa mU1Vluhc69pQcQbgOs5ZFEBdQ2ghXbsG96PZCQYo79o+SkvMvNFQMflh7psr5mTQysqB Co2eKOkgO8spEdKKBwWhYGGP7ERZu3xItGmq9PdIJmcjPAi8OT1Xt0k9Hq1oNAiqxjME Sgrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si150021ejv.17.2021.02.02.14.41.36; Tue, 02 Feb 2021 14:42:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbhBBPnJ (ORCPT + 99 others); Tue, 2 Feb 2021 10:43:09 -0500 Received: from verein.lst.de ([213.95.11.211]:46798 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235663AbhBBPmd (ORCPT ); Tue, 2 Feb 2021 10:42:33 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 4164167373; Tue, 2 Feb 2021 16:41:49 +0100 (CET) Date: Tue, 2 Feb 2021 16:41:48 +0100 From: Christoph Hellwig To: Miroslav Benes Cc: Christoph Hellwig , Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol Message-ID: <20210202154148.GA12433@lst.de> References: <20210202121334.1361503-1-hch@lst.de> <20210202121334.1361503-11-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 02, 2021 at 03:07:51PM +0100, Miroslav Benes wrote: > > preempt_disable(); > > - sym = find_symbol(symbol, &owner, NULL, NULL, true, true); > > - if (sym && strong_try_module_get(owner)) > > - sym = NULL; > > + if (!find_symbol(&fsa) || !strong_try_module_get(fsa.owner)) { > > I think this should be in fact > > if (!find_symbol(&fsa) || strong_try_module_get(fsa.owner)) { > > to get the logic right (note the missing !). We want to return NULL if > strong_try_module_get() does not succeed for a found symbol. Indeed. Fixed for the next version.