Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp22933rdb; Mon, 18 Dec 2023 07:58:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtPc5DF1OpRTqltuKgFB+rzkHm1HeA4OnMlGKuxygvGKZevnwW0FiQ++Nf5Rj1hk+rbwWN X-Received: by 2002:a05:6358:6f1c:b0:172:ae5d:8d31 with SMTP id r28-20020a0563586f1c00b00172ae5d8d31mr6058833rwn.16.1702915135216; Mon, 18 Dec 2023 07:58:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702915135; cv=none; d=google.com; s=arc-20160816; b=oB6dKNswxAf/H4vmol2EDym3oF/Y5bzOth2uuJGvFpGpDwG3HMj0Xs/Lzf/0TpVH7A ntWLsHxsTXNoluOmLjHckuNWKddKxxkDIxK7mxej6xoXt8oCjQHljZck/cb7e5Rqhtl7 /gMOuqxZY83qSnPRHKh+Rbr0DNRekugGd/nFIauig/fPYYsB5X+JoxCeBirboa6c4Rng olYT/uOQouOckpHfl6uleWnTvp69ZYKALPGwwbJVr5ZNnPzazIZjBw0GWe1QT9RmWXZQ PgAPliYyKIPsyLauq98+H9/kS29fBHGt5lLO4WcB4Fzv7C55t3le5DWdt3HEv9Wf4Ja3 lDDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=QJDvPsNpDSFcwlZxk9YgfJH4JSGSTnY9Rh1/tTKUSxI=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=lMxFd1owXsG9FKgaVBQh3NifJ/QNiGT4MtcI684GYQERKCbXePwmy+yHHaVxXgg1zR aFiG1psCk4qpUL1IUiQHD348PiFhrVfLypY4jbAWjS8VVxhqWdoV7aBqGMfLoKs1v+K1 t1HpFGcrU/jLjCptTPnIREGT2qR5PJpIKype1d7KK7WbyCqfYeVP3kEBnup8ztueZ9Gs w6sVlH+XBnowSce3LHQvlGf3gTiA51iBVNfaFckrEqOc0dciGiH4SdFYAKmKkWH6+3xz ui38gq3k488TfIHLhTMWe6ZOgQfqSEe8w/yLZDQj70X0AHHAQkZM7T17aFOLu+qkmPsm +lEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a19-20020a656413000000b005c67e10f23bsi1336767pgv.362.2023.12.18.07.58.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:58:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 D3DCC284D34 for ; Mon, 18 Dec 2023 15:58:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77D9A42387; Mon, 18 Dec 2023 15:58:24 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 97FE549897 for ; Mon, 18 Dec 2023 15:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DFFD321FA4; Mon, 18 Dec 2023 15:58:20 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id CD8EE13BD5; Mon, 18 Dec 2023 15:58:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id KWP4MBxsgGX5AgAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 15:58:20 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , James Smart , Hannes Reinecke , Daniel Wagner Subject: [PATCH v3 11/16] nvmet-fc: remove null hostport pointer check Date: Mon, 18 Dec 2023 16:30:59 +0100 Message-ID: <20231218153105.12717-12-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: -4.00 X-Rspamd-Queue-Id: DFFD321FA4 An association has always a valid hostport pointer. Remove useless null pointer check. Signed-off-by: Daniel Wagner --- drivers/nvme/target/fc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index fa7a6d2edd88..c243085d6f42 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -489,8 +489,7 @@ nvmet_fc_xmt_disconnect_assoc(struct nvmet_fc_tgt_assoc *assoc) * message is normal. Otherwise, send unless the hostport has * already been invalidated by the lldd. */ - if (!tgtport->ops->ls_req || !assoc->hostport || - assoc->hostport->invalid) + if (!tgtport->ops->ls_req || assoc->hostport->invalid) return; lsop = kzalloc((sizeof(*lsop) + @@ -1530,8 +1529,7 @@ nvmet_fc_invalidate_host(struct nvmet_fc_target_port *target_port, spin_lock_irqsave(&tgtport->lock, flags); list_for_each_entry_safe(assoc, next, &tgtport->assoc_list, a_list) { - if (!assoc->hostport || - assoc->hostport->hosthandle != hosthandle) + if (assoc->hostport->hosthandle != hosthandle) continue; if (!nvmet_fc_tgt_a_get(assoc)) continue; -- 2.43.0