Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,14 @@ static int list_subsys(int argc, char **argv, struct command *cmd,

if (devname) {
int subsys_num;
struct stat st;
char path[512];

sprintf(path, "/dev/%s", devname);
if (stat(path, &st) != 0) {
nvme_show_error("%s does not exist", path);
return -EINVAL;
}

if (sscanf(devname, "nvme%dn%d", &subsys_num, &nsid) != 2) {
nvme_show_error("Invalid device name %s", devname);
Expand Down