Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ib-srpt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

Cleanups and error path fixes for the new SRP (SCSI RDMA protocol) target.

* tag 'ib-srpt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IB/srpt: Don't return freed pointer from srpt_alloc_ioctx_ring()
IB/srpt: Fix ERR_PTR() vs. NULL checking confusion
IB/srpt: Remove unneeded <linux/version.h> include
IB/srpt: Use ARRAY_SIZE() instead of open-coding
IB/srpt: Use DEFINE_SPINLOCK()/LIST_HEAD()

+7 -11
+7 -10
drivers/infiniband/ulp/srpt/ib_srpt.c
··· 69 69 */ 70 70 71 71 static u64 srpt_service_guid; 72 - static spinlock_t srpt_dev_lock; /* Protects srpt_dev_list. */ 73 - static struct list_head srpt_dev_list; /* List of srpt_device structures. */ 72 + static DEFINE_SPINLOCK(srpt_dev_lock); /* Protects srpt_dev_list. */ 73 + static LIST_HEAD(srpt_dev_list); /* List of srpt_device structures. */ 74 74 75 75 static unsigned srp_max_req_size = DEFAULT_MAX_REQ_SIZE; 76 76 module_param(srp_max_req_size, int, 0444); ··· 687 687 while (--i >= 0) 688 688 srpt_free_ioctx(sdev, ring[i], dma_size, dir); 689 689 kfree(ring); 690 + ring = NULL; 690 691 out: 691 692 return ring; 692 693 } ··· 2596 2595 } 2597 2596 2598 2597 ch->sess = transport_init_session(); 2599 - if (!ch->sess) { 2598 + if (IS_ERR(ch->sess)) { 2600 2599 rej->reason = __constant_cpu_to_be32( 2601 2600 SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); 2602 2601 pr_debug("Failed to create session\n"); ··· 3265 3264 for (i = 0; i < sdev->srq_size; ++i) 3266 3265 srpt_post_recv(sdev, sdev->ioctx_ring[i]); 3267 3266 3268 - WARN_ON(sdev->device->phys_port_cnt 3269 - > sizeof(sdev->port)/sizeof(sdev->port[0])); 3267 + WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port)); 3270 3268 3271 3269 for (i = 1; i <= sdev->device->phys_port_cnt; i++) { 3272 3270 sport = &sdev->port[i - 1]; ··· 4010 4010 goto out; 4011 4011 } 4012 4012 4013 - spin_lock_init(&srpt_dev_lock); 4014 - INIT_LIST_HEAD(&srpt_dev_list); 4015 - 4016 - ret = -ENODEV; 4017 4013 srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); 4018 - if (!srpt_target) { 4014 + if (IS_ERR(srpt_target)) { 4019 4015 printk(KERN_ERR "couldn't register\n"); 4016 + ret = PTR_ERR(srpt_target); 4020 4017 goto out; 4021 4018 } 4022 4019
-1
drivers/infiniband/ulp/srpt/ib_srpt.h
··· 35 35 #ifndef IB_SRPT_H 36 36 #define IB_SRPT_H 37 37 38 - #include <linux/version.h> 39 38 #include <linux/types.h> 40 39 #include <linux/list.h> 41 40 #include <linux/wait.h>