Message ID | 20200421124017.272694-14-lee.jones@linaro.org |
---|---|
State | New |
Headers | show |
Series | [4.14,01/24] drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem | expand |
diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 2b54e71886d9c..69a14041ef1fe 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -212,6 +212,7 @@ struct qcom_glink *qcom_glink_smem_register(struct device *parent, ret = device_register(dev); if (ret) { pr_err("failed to register glink edge\n"); + put_device(dev); return ERR_PTR(ret); } @@ -294,7 +295,7 @@ struct qcom_glink *qcom_glink_smem_register(struct device *parent, return glink; err_put_dev: - put_device(dev); + device_unregister(dev); return ERR_PTR(ret); }