* re: lpfc: Modularize and cleanup FDMI code in driver
@ 2016-02-01 11:01 Dan Carpenter
2016-02-11 15:07 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-02-01 11:01 UTC (permalink / raw)
To: james.smart; +Cc: linux-scsi
Hello James Smart,
The patch 4258e98ee386: "lpfc: Modularize and cleanup FDMI code in
driver" from Dec 16, 2015, leads to the following static checker
warning:
drivers/scsi/lpfc/lpfc_ct.c:2547 lpfc_fdmi_cmd()
error: __memcpy() '&rh->rpl.pe' too small (4 vs 8)
drivers/scsi/lpfc/lpfc_ct.c
2534 /* Next fill in the specific FDMI cmd information */
2535 switch (cmdcode) {
2536 case SLI_MGMT_RHAT:
2537 case SLI_MGMT_RHBA:
2538 rh = (struct lpfc_fdmi_reg_hba *)&CtReq->un.PortID;
2539 /* HBA Identifier */
2540 memcpy(&rh->hi.PortName, &phba->pport->fc_sparam.portName,
2541 sizeof(struct lpfc_name));
2542
2543 if (cmdcode == SLI_MGMT_RHBA) {
2544 /* Registered Port List */
2545 /* One entry (port) per adapter */
2546 rh->rpl.EntryCnt = cpu_to_be32(1);
2547 memcpy(&rh->rpl.pe, &phba->pport->fc_sparam.portName,
^^^^^^^^^^^
.pe is a u32.
2548 sizeof(struct lpfc_name));
^^^^^^^^^^^^^^^^^^^^^^^^
lpfc_name is an 8 byte union.
2549
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: lpfc: Modularize and cleanup FDMI code in driver
2016-02-01 11:01 lpfc: Modularize and cleanup FDMI code in driver Dan Carpenter
@ 2016-02-11 15:07 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-02-11 15:07 UTC (permalink / raw)
To: Dick Kennedy; +Cc: Dan Carpenter, james.smart, linux-scsi
>>>>> "Dan" == Dan Carpenter <dan.carpenter@oracle.com> writes:
Dick,
Please look into this...
---8<---
The patch 4258e98ee386: "lpfc: Modularize and cleanup FDMI code in
driver" from Dec 16, 2015, leads to the following static checker
warning:
drivers/scsi/lpfc/lpfc_ct.c:2547 lpfc_fdmi_cmd()
error: __memcpy() '&rh->rpl.pe' too small (4 vs 8)
drivers/scsi/lpfc/lpfc_ct.c
2534 /* Next fill in the specific FDMI cmd information */
2535 switch (cmdcode) {
2536 case SLI_MGMT_RHAT:
2537 case SLI_MGMT_RHBA:
2538 rh = (struct lpfc_fdmi_reg_hba *)&CtReq->un.PortID;
2539 /* HBA Identifier */
2540 memcpy(&rh->hi.PortName, &phba->pport->fc_sparam.portName,
2541 sizeof(struct lpfc_name));
2542
2543 if (cmdcode == SLI_MGMT_RHBA) {
2544 /* Registered Port List */
2545 /* One entry (port) per adapter */
2546 rh->rpl.EntryCnt = cpu_to_be32(1);
2547 memcpy(&rh->rpl.pe, &phba->pport->fc_sparam.portName,
^^^^^^^^^^^
.pe is a u32.
2548 sizeof(struct lpfc_name));
^^^^^^^^^^^^^^^^^^^^^^^^
lpfc_name is an 8 byte union.
2549
regards,
dan carpenter
---8<---
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-11 15:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 11:01 lpfc: Modularize and cleanup FDMI code in driver Dan Carpenter
2016-02-11 15:07 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.