public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org,
	Karan Tilak Kumar <kartilak@cisco.com>,
	Sesidhar Baddela <sebaddel@cisco.com>,
	Satish Kharat <satishkh@cisco.com>,
	Hannes Reinecke <hare@kernel.org>
Subject: [PATCH 2/4] fnic: correctly initialize 'fnic->name'
Date: Tue,  4 Nov 2025 11:04:22 +0100	[thread overview]
Message-ID: <20251104100424.8215-3-hare@kernel.org> (raw)
In-Reply-To: <20251104100424.8215-1-hare@kernel.org>

The instance name is required for setting up interrupt handlers, so
set it early enough to avoid the request_irq() routine crashing on
duplicate or empty names.

Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 drivers/scsi/fnic/fnic_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 7075a23d9229..870b265be41a 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -575,9 +575,6 @@ static void fnic_scsi_init(struct fnic *fnic)
 {
 	struct Scsi_Host *host = fnic->host;
 
-	snprintf(fnic->name, sizeof(fnic->name) - 1, "%s%d", DRV_NAME,
-			 host->host_no);
-
 	host->transportt = fnic_fc_transport;
 }
 
@@ -732,6 +729,8 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	fnic->pdev = pdev;
 	fnic->fnic_num = fnic_id;
+	snprintf(fnic->name, sizeof(fnic->name) - 1, "%s%d", DRV_NAME,
+		 fnic->fnic_num);
 
 	/* Find model name from PCIe subsys ID */
 	if (fnic_get_desc_by_devid(pdev, &desc, &subsys_desc) == 0) {
-- 
2.43.0


  parent reply	other threads:[~2025-11-04 10:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 10:04 [PATCH 0/4] fnic: fixup INTx and MSI interrupt modes Hannes Reinecke
2025-11-04 10:04 ` [PATCH 1/4] fnic: use resulting interrupt mode during configuration Hannes Reinecke
2025-11-04 23:17   ` Karan Tilak Kumar (kartilak)
2025-11-06 21:56   ` Karan Tilak Kumar (kartilak)
2025-11-04 10:04 ` Hannes Reinecke [this message]
2025-11-04 23:18   ` [PATCH 2/4] fnic: correctly initialize 'fnic->name' Karan Tilak Kumar (kartilak)
2025-11-06 21:57   ` Karan Tilak Kumar (kartilak)
2025-11-04 10:04 ` [PATCH 3/4] fnic: missing initialisation for wq_copy_base Hannes Reinecke
2025-11-04 23:19   ` Karan Tilak Kumar (kartilak)
2025-11-06 22:00   ` Karan Tilak Kumar (kartilak)
2025-11-04 10:04 ` [PATCH 4/4] fnic: make interrupt mode configurable Hannes Reinecke
2025-11-04 23:21   ` Karan Tilak Kumar (kartilak)
2025-11-06 22:09   ` Karan Tilak Kumar (kartilak)
2025-11-07  8:29     ` Hannes Reinecke
2025-11-07 22:23       ` Karan Tilak Kumar (kartilak)
2026-01-14 17:02         ` Karan Tilak Kumar (kartilak)
2026-01-23 18:21           ` Lee Duncan
2026-01-23 18:37             ` Karan Tilak Kumar (kartilak)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251104100424.8215-3-hare@kernel.org \
    --to=hare@kernel.org \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=kartilak@cisco.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox