diff options
-rw-r--r-- | drivers/of/device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 3caaaf107076..8271793ef379 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -385,6 +385,8 @@ int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) sl = of_device_get_modalias(dev, &env->buf[env->buflen-1], sizeof(env->buf) - env->buflen); + if (sl < 0) + return sl; if (sl >= (sizeof(env->buf) - env->buflen)) return -ENOMEM; env->buflen += sl; |