diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index e3e085e33d46bffff855307269592d0452aa92e6..9065d3e71ff7683a02a3183aa9f7cbf8f491cf4f 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1613,8 +1613,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) domains[domain_id]); data->miscdev.fops = &fastrpc_fops; err = misc_register(&data->miscdev); - if (err) + if (err) { + kfree(data); return err; + } kref_init(&data->refcount);