mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 06:14:27 +00:00
Add debug writes in error cases that, in theory, should never happen
This commit is contained in:
parent
723c740a55
commit
5ec7256cb1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157564
|
@ -201,11 +201,14 @@ at91_add_child(device_t dev, int prio, const char *name, int unit,
|
|||
struct at91_ivar *ivar;
|
||||
|
||||
kid = device_add_child_ordered(dev, prio, name, unit);
|
||||
if (kid == NULL)
|
||||
return;
|
||||
if (kid == NULL) {
|
||||
printf("Can't add child %s%d ordered\n", name, unit);
|
||||
return;
|
||||
}
|
||||
ivar = malloc(sizeof(*ivar), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
if (ivar == NULL) {
|
||||
device_delete_child(dev, kid);
|
||||
printf("Can't add alloc ivar\n");
|
||||
return;
|
||||
}
|
||||
device_set_ivars(kid, ivar);
|
||||
|
|
Loading…
Reference in a new issue