[PATCH] Several FreeBSD CAM changes merge
--0eh6TmSyL6TZE2Uz
Content-Type: multipart/mixed; boundary="fdj2RfSjLxBAspz7"
Content-Disposition: inline
--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
FYI. It seems that same issue exists in DFly as well, please review
the patch and consider a commit.
Cheers,
--=20
Xin LI <delphij frontfree net> http://www.delphij.net/
See complete headers for GPG key and other information.
--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-dfly-cam
Content-Transfer-Encoding: quoted-printable
Index: cam_periph.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/bus/cam/cam_periph.c,v
retrieving revision 1.8
diff -u -r1.8 cam_periph.c
--- cam_periph.c 12 Mar 2004 03:23:13 -0000 1.8
+++ cam_periph.c 15 Mar 2005 16:54:06 -0000
@@ -399,7 +399,12 @@
if (strcmp((*p_drv)->driver_name, periph->periph_name) =3D=3D 0)
break;
}
-=09
+
+ if (*p_drv =3D=3D NULL) {
+ printf("camperiphfree: attempt to free non-existant periph\n");
+ return;
+ }
+
if (periph->periph_dtor !=3D NULL)
periph->periph_dtor(periph);
=09
Index: cam_xpt.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/bus/cam/cam_xpt.c,v
retrieving revision 1.22
diff -u -r1.22 cam_xpt.c
--- cam_xpt.c 5 Mar 2005 18:29:24 -0000 1.22
+++ cam_xpt.c 15 Mar 2005 16:51:19 -0000
@@ -2333,7 +2333,7 @@
break;
}
=20
- if (pdrv =3D=3D NULL) {
+ if (*pdrv =3D=3D NULL) {
cdm->status =3D CAM_DEV_MATCH_ERROR;
return(0);
}
Index: scsi/scsi_all.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/bus/cam/scsi/scsi_all.c,v
retrieving revision 1.4
diff -u -r1.4 scsi_all.c
--- scsi/scsi_all.c 29 Dec 2003 06:42:10 -0000 1.4
+++ scsi/scsi_all.c 15 Mar 2005 16:59:42 -0000
@@ -1689,7 +1689,7 @@
* XXX KDM this is stupid, but casting the
* structure doesn't work...
*/
- bcopy(&csio->sense_data, sense,=20
+ bcopy(&csio->sense_data, &sense,=20
sizeof(struct scsi_sense_data *));
}
} else {
@@ -1874,7 +1874,7 @@
* XXX KDM this is stupid, but casting the
* structure doesn't work...
*/
- bcopy(&csio->sense_data, sense,=20
+ bcopy(&csio->sense_data, &sense,=20
sizeof(struct scsi_sense_data *));
}
} else {
Index: scsi/scsi_target.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/bus/cam/scsi/scsi_target.c,v
retrieving revision 1.9
diff -u -r1.9 scsi_target.c
--- scsi/scsi_target.c 19 May 2004 22:52:38 -0000 1.9
+++ scsi/scsi_target.c 15 Mar 2005 16:55:03 -0000
@@ -532,7 +532,6 @@
("write - uio_resid %d\n", uio->uio_resid));
while (uio->uio_resid >=3D sizeof(user_ccb) && error =3D=3D 0) {
union ccb *ccb;
- int error;
=20
error =3D uiomove((caddr_t)&user_ccb, sizeof(user_ccb), uio);
if (error !=3D 0) {
--fdj2RfSjLxBAspz7--
--0eh6TmSyL6TZE2Uz
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)
iD8DBQFCNxVD/cVsHxFZiIoRAhOzAJ48iDRZIRh/2pqN68V8Po1rzTHpVwCcCB6l
csRjf9SjGcLQSyLhpbG+JdM=
=kr8Z
-----END PGP SIGNATURE-----
--0eh6TmSyL6TZE2Uz--
討論串 (同標題文章)