@@ -3480,7 +3480,7 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns)
3480
3480
return 0 ;
3481
3481
}
3482
3482
3483
- static int nvme_alloc_ns (struct nvme_ctrl * ctrl , unsigned nsid )
3483
+ static void nvme_alloc_ns (struct nvme_ctrl * ctrl , unsigned nsid )
3484
3484
{
3485
3485
struct nvme_ns * ns ;
3486
3486
struct gendisk * disk ;
@@ -3490,13 +3490,11 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3490
3490
3491
3491
ns = kzalloc_node (sizeof (* ns ), GFP_KERNEL , node );
3492
3492
if (!ns )
3493
- return - ENOMEM ;
3493
+ return ;
3494
3494
3495
3495
ns -> queue = blk_mq_init_queue (ctrl -> tagset );
3496
- if (IS_ERR (ns -> queue )) {
3497
- ret = PTR_ERR (ns -> queue );
3496
+ if (IS_ERR (ns -> queue ))
3498
3497
goto out_free_ns ;
3499
- }
3500
3498
3501
3499
if (ctrl -> opts && ctrl -> opts -> data_digest )
3502
3500
ns -> queue -> backing_dev_info -> capabilities
@@ -3519,10 +3517,8 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3519
3517
if (ret )
3520
3518
goto out_free_queue ;
3521
3519
3522
- if (id -> ncap == 0 ) {
3523
- ret = - EINVAL ;
3520
+ if (id -> ncap == 0 ) /* no namespace (legacy quirk) */
3524
3521
goto out_free_id ;
3525
- }
3526
3522
3527
3523
ret = nvme_init_ns_head (ns , nsid , id );
3528
3524
if (ret )
@@ -3531,10 +3527,8 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3531
3527
nvme_set_disk_name (disk_name , ns , ctrl , & flags );
3532
3528
3533
3529
disk = alloc_disk_node (0 , node );
3534
- if (!disk ) {
3535
- ret = - ENOMEM ;
3530
+ if (!disk )
3536
3531
goto out_unlink_ns ;
3537
- }
3538
3532
3539
3533
disk -> fops = & nvme_fops ;
3540
3534
disk -> private_data = ns ;
@@ -3565,7 +3559,7 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3565
3559
nvme_fault_inject_init (& ns -> fault_inject , ns -> disk -> disk_name );
3566
3560
kfree (id );
3567
3561
3568
- return 0 ;
3562
+ return ;
3569
3563
out_put_disk :
3570
3564
put_disk (ns -> disk );
3571
3565
out_unlink_ns :
@@ -3579,9 +3573,6 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3579
3573
blk_cleanup_queue (ns -> queue );
3580
3574
out_free_ns :
3581
3575
kfree (ns );
3582
- if (ret > 0 )
3583
- ret = blk_status_to_errno (nvme_error_status (ret ));
3584
- return ret ;
3585
3576
}
3586
3577
3587
3578
static void nvme_ns_remove (struct nvme_ns * ns )
0 commit comments