diff options
author | imp <imp@FreeBSD.org> | 2006-09-06 20:22:43 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-09-06 20:22:43 +0000 |
commit | 2786b657b920d7d40f7d54a9e20941e8d399e345 (patch) | |
tree | 8ebb09d9dcef9930d478050392317b8295dc18bc /sys/dev/iicbus | |
parent | a91c39740f9997269193da0d48c103338454d72d (diff) | |
download | FreeBSD-src-2786b657b920d7d40f7d54a9e20941e8d399e345.zip FreeBSD-src-2786b657b920d7d40f7d54a9e20941e8d399e345.tar.gz |
jhb points out that these mallocs don't need to be checked because
of M_WAITOK.
Diffstat (limited to 'sys/dev/iicbus')
-rw-r--r-- | sys/dev/iicbus/iic.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index 038a8e8..b50d2e0 100644 --- a/sys/dev/iicbus/iic.c +++ b/sys/dev/iicbus/iic.c @@ -282,10 +282,6 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t break; } buf = malloc((unsigned long)s->count, M_TEMP, M_WAITOK); - if (buf == NULL) { - error = ENOMEM; - break; - } error = copyin(s->buf, buf, s->count); if (error) break; @@ -298,10 +294,6 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t break; } buf = malloc((unsigned long)s->count, M_TEMP, M_WAITOK); - if (buf == NULL) { - error = ENOMEM; - break; - } error = iicbus_read(parent, buf, s->count, &count, s->last, 10); if (error) break; @@ -310,15 +302,7 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t case I2CRDWR: buf = malloc(sizeof(*d->msgs) * d->nmsgs, M_TEMP, M_WAITOK); - if (buf == NULL) { - error = ENOMEM; - break; - } usrbufs = malloc(sizeof(void *) * d->nmsgs, M_TEMP, M_ZERO | M_WAITOK); - if (usrbufs == NULL) { - error = ENOMEM; - break; - } error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs); if (error) break; |