Commit 1a58a3be authored by Johan Hovold's avatar Johan Hovold

greybus: core: fix hd-creation error path

Make sure to return an errno when a host-device buffer-size check fails.

Fixes: 1f92f6404614 ("core: return error code when creating host device")
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent f470ead8
......@@ -184,7 +184,7 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver
if (buffer_size_max < GB_OPERATION_MESSAGE_SIZE_MIN) {
dev_err(parent, "greybus host-device buffers too small\n");
return NULL;
return ERR_PTR(-EINVAL);
}
if (num_cports == 0 || num_cports > CPORT_ID_MAX) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment