[PATCH nvme-cli] nvme : Don't seg fault if given device is not char/block device

Daniel Wagner dwagner at suse.de
Wed Mar 20 00:16:21 PDT 2024


On Sun, Mar 17, 2024 at 05:06:22PM +0530, Nilay Shroff wrote:
> If the given device name is not char/block device then in
> open_dev_direct() set errno to ENODEV and err to -1 before
> returning to the dev_fd(). This would then ensure that in
> case of error, dev_fd() returns the corerct negative error
> code back to its callers. So now the callers of dev_fd()
> would handle the error appropriately instead of try
> accessing the nvme_dev which would be NULL.
> 
> Signed-off-by: Nilay Shroff <nilay at linux.ibm.com>

Patch applied. Thanks.



More information about the Linux-nvme mailing list