Make sure that we get the sbuf resources we need.
Since we're calling sbuf_new with NOWAIT, make sure it can allocate a buffer to use. Don't print anything if we can't get it. Noticed by: rpokala
This commit is contained in:
parent
1c63fddbd7
commit
b8ce7e8464
@ -59,7 +59,8 @@ nvme_ctrlr_devctl_log(struct nvme_controller *ctrlr, const char *type, const cha
|
||||
va_list ap;
|
||||
int error;
|
||||
|
||||
sbuf_new(&sb, NULL, 0, SBUF_AUTOEXTEND | SBUF_NOWAIT);
|
||||
if (sbuf_new(&sb, NULL, 0, SBUF_AUTOEXTEND | SBUF_NOWAIT) == NULL)
|
||||
return;
|
||||
sbuf_printf(&sb, "%s: ", device_get_nameunit(ctrlr->dev));
|
||||
va_start(ap, msg);
|
||||
sbuf_vprintf(&sb, msg, ap);
|
||||
|
Loading…
Reference in New Issue
Block a user