Remove NULL checks after M_WAITOK allocations from sys/dev/ofw/.

MFC after:	1 month
This commit is contained in:
Edward Tomasz Napierala 2016-08-09 15:55:14 +00:00
parent 4466486fb6
commit 108c227330
2 changed files with 0 additions and 18 deletions

View File

@ -100,8 +100,6 @@ openfirm_getstr(int len, const char *user, char **cpp)
return (ENAMETOOLONG);
*cpp = cp = malloc(len + 1, M_TEMP, M_WAITOK);
if (cp == NULL)
return (ENOMEM);
error = copyin(user, cp, len);
cp[len] = '\0';
return (error);
@ -173,10 +171,6 @@ openfirm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
if (len <= 0)
break;
value = malloc(len, M_TEMP, M_WAITOK);
if (value == NULL) {
error = ENOMEM;
break;
}
len = OF_getprop(node, name, (void *)value, len);
error = copyout(value, of->of_buf, len);
break;
@ -199,10 +193,6 @@ openfirm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
if (error)
break;
value = malloc(of->of_buflen, M_TEMP, M_WAITOK);
if (value == NULL) {
error = ENOMEM;
break;
}
error = copyin(of->of_buf, value, of->of_buflen);
if (error)
break;

View File

@ -151,18 +151,10 @@ openprom_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
break;
}
prop = malloc(len, M_TEMP, M_WAITOK | M_ZERO);
if (prop == NULL) {
error = ENOMEM;
break;
}
error = copyinstr(&oprom->oprom_array, prop, len, &done);
if (error != 0)
break;
buf = malloc(OPROMMAXPARAM, M_TEMP, M_WAITOK | M_ZERO);
if (buf == NULL) {
error = ENOMEM;
break;
}
node = openprom_node;
switch (cmd) {
case OPROMGETPROP: