Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1717833
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "Gustavo A. R. Silva" <gustavo@embeddedor.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test |
| Date | Tue, 22 Aug 2017 23:00:03 +0200 |
| Message-ID | <uhorg-7Cb-23@gated-at.bofh.it> (permalink) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.23 (2014-03-12) |
| X-Antiabuse | This header was added to track abuse, please include it with any abuse report |
| X-Antiabuse | Primary Hostname - gator4166.hostgator.com |
| X-Antiabuse | Original Domain - vger.kernel.org |
| X-Antiabuse | Originator/Caller UID/GID - [47 12] / [47 12] |
| X-Antiabuse | Sender Address Domain - embeddedor.com |
| X-Bwhitelist | no |
| X-Source-IP | 189.152.158.27 |
| X-Exim-ID | 1dkGBO-003bjn-F9 |
| X-Source-Sender | (embeddedgus) [189.152.158.27]:43368 |
| X-Source-Auth | gustavo@embeddedor.com |
| X-Email-Count | 12 |
| X-Source-Cap | Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= |
| X-Local-Domain | yes |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 43 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" <gustavo@embeddedor.com> |
| X-Original-Date | Tue, 22 Aug 2017 15:53:53 -0500 |
| X-Original-Message-ID | <20170822205353.GA17794@embeddedgus> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1717833 |
Show key headers only | View raw
Remove variable assignments. The value stored in local variable _rc_ is
overwritten at line 2448:rc = lpfc_sli4_bsg_set_link_diag_state(phba, 0);
before it can be used.
Addresses-Coverity-ID: 1226935
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
This issue was detected by Coverity and it was tested by compilation only.
Notice that this code has been there since 2011.
drivers/scsi/lpfc/lpfc_bsg.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index a1686c2..fe9e1c0 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -2384,20 +2384,17 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)
goto job_error;
pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
- if (!pmboxq) {
- rc = -ENOMEM;
+ if (!pmboxq)
goto link_diag_test_exit;
- }
req_len = (sizeof(struct lpfc_mbx_set_link_diag_state) -
sizeof(struct lpfc_sli4_cfg_mhdr));
alloc_len = lpfc_sli4_config(phba, pmboxq, LPFC_MBOX_SUBSYSTEM_FCOE,
LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE,
req_len, LPFC_SLI4_MBX_EMBED);
- if (alloc_len != req_len) {
- rc = -ENOMEM;
+ if (alloc_len != req_len)
goto link_diag_test_exit;
- }
+
run_link_diag_test = &pmboxq->u.mqe.un.link_diag_test;
bf_set(lpfc_mbx_run_diag_test_link_num, &run_link_diag_test->u.req,
phba->sli4_hba.lnk_info.lnk_no);
--
2.5.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test "Gustavo A. R. Silva" <gustavo@embeddedor.com> - 2017-08-22 23:00 +0200
Re: [PATCH] scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test James Smart <james.smart@broadcom.com> - 2017-08-23 18:30 +0200
Re: [PATCH] scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-08-24 04:50 +0200
Re: [PATCH] scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test "Gustavo A. R. Silva" <gustavo@embeddedor.com> - 2017-08-24 17:30 +0200
csiph-web