Fix more wrong sizeof() usages, part 2/x
authorSascha Wildner <saw@online.de>
Sun, 17 Jun 2012 01:28:37 +0000 (03:28 +0200)
committerSascha Wildner <saw@online.de>
Sun, 17 Jun 2012 01:28:37 +0000 (03:28 +0200)
Take the size of the struct instead of the size of its address.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

sys/dev/disk/mpt/mpt_cam.c
sys/dev/raid/mps/mps_sas.c

index 8f9f2f4..462195d 100644 (file)
@@ -3180,7 +3180,7 @@ mpt_scsi_reply_frame_handler(struct mpt_softc *mpt, request_t *req,
                else
                        ccb->csio.sense_resid = 0;
 
-               bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data));
+               bzero(&ccb->csio.sense_data, sizeof(ccb->csio.sense_data));
                bcopy(req->sense_vbuf, &ccb->csio.sense_data,
                    min(ccb->csio.sense_len, sense_returned));
        }
index 45bba9a..9db3ead 100644 (file)
@@ -1907,7 +1907,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm)
                        sense_len = min(returned_sense_len,
                            ccb->csio.sense_len - ccb->csio.sense_resid);
                        bzero(&ccb->csio.sense_data,
-                             sizeof(&ccb->csio.sense_data));
+                             sizeof(ccb->csio.sense_data));
                        bcopy(cm->cm_sense, &ccb->csio.sense_data, sense_len);
                        ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
                }