diff options
Diffstat (limited to 'drivers/scsi/bfa/bfad_bsg.c')
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 8994fb857ee9..023b9d42ad9a 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
@@ -26,7 +26,6 @@ int | |||
26 | bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd) | 26 | bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd) |
27 | { | 27 | { |
28 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | 28 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; |
29 | int rc = 0; | ||
30 | unsigned long flags; | 29 | unsigned long flags; |
31 | 30 | ||
32 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 31 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
@@ -34,7 +33,7 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd) | |||
34 | if (!bfa_ioc_is_disabled(&bfad->bfa.ioc)) { | 33 | if (!bfa_ioc_is_disabled(&bfad->bfa.ioc)) { |
35 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 34 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
36 | iocmd->status = BFA_STATUS_OK; | 35 | iocmd->status = BFA_STATUS_OK; |
37 | return rc; | 36 | return 0; |
38 | } | 37 | } |
39 | 38 | ||
40 | init_completion(&bfad->enable_comp); | 39 | init_completion(&bfad->enable_comp); |
@@ -43,21 +42,20 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd) | |||
43 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 42 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
44 | wait_for_completion(&bfad->enable_comp); | 43 | wait_for_completion(&bfad->enable_comp); |
45 | 44 | ||
46 | return rc; | 45 | return 0; |
47 | } | 46 | } |
48 | 47 | ||
49 | int | 48 | int |
50 | bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd) | 49 | bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd) |
51 | { | 50 | { |
52 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | 51 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; |
53 | int rc = 0; | ||
54 | unsigned long flags; | 52 | unsigned long flags; |
55 | 53 | ||
56 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 54 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
57 | if (bfa_ioc_is_disabled(&bfad->bfa.ioc)) { | 55 | if (bfa_ioc_is_disabled(&bfad->bfa.ioc)) { |
58 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 56 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
59 | iocmd->status = BFA_STATUS_OK; | 57 | iocmd->status = BFA_STATUS_OK; |
60 | return rc; | 58 | return 0; |
61 | } | 59 | } |
62 | 60 | ||
63 | if (bfad->disable_active) { | 61 | if (bfad->disable_active) { |
@@ -74,7 +72,7 @@ bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd) | |||
74 | bfad->disable_active = BFA_FALSE; | 72 | bfad->disable_active = BFA_FALSE; |
75 | iocmd->status = BFA_STATUS_OK; | 73 | iocmd->status = BFA_STATUS_OK; |
76 | 74 | ||
77 | return rc; | 75 | return 0; |
78 | } | 76 | } |
79 | 77 | ||
80 | static int | 78 | static int |
@@ -3270,13 +3268,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf, | |||
3270 | /* Allocate dma coherent memory */ | 3268 | /* Allocate dma coherent memory */ |
3271 | buf_info = buf_base; | 3269 | buf_info = buf_base; |
3272 | buf_info->size = payload_len; | 3270 | buf_info->size = payload_len; |
3273 | buf_info->virt = dma_alloc_coherent(&bfad->pcidev->dev, buf_info->size, | 3271 | buf_info->virt = dma_zalloc_coherent(&bfad->pcidev->dev, |
3274 | &buf_info->phys, GFP_KERNEL); | 3272 | buf_info->size, &buf_info->phys, |
3273 | GFP_KERNEL); | ||
3275 | if (!buf_info->virt) | 3274 | if (!buf_info->virt) |
3276 | goto out_free_mem; | 3275 | goto out_free_mem; |
3277 | 3276 | ||
3278 | /* copy the linear bsg buffer to buf_info */ | 3277 | /* copy the linear bsg buffer to buf_info */ |
3279 | memset(buf_info->virt, 0, buf_info->size); | ||
3280 | memcpy(buf_info->virt, payload_kbuf, buf_info->size); | 3278 | memcpy(buf_info->virt, payload_kbuf, buf_info->size); |
3281 | 3279 | ||
3282 | /* | 3280 | /* |