浏览代码

[media] frontends/ix2505v: Remember to free allocated memory in failure path

We may leak the storage allocated to 'state' in
drivers/media/dvb/frontends/ix2505v.c::ix2505v_attach() on error, as
it is too early to be able to call ix2505v_release().

This patch makes sure we free the allocated memory in the failure case.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jesper Juhl 14 年之前
父节点
当前提交
36fd97884d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/media/dvb/frontends/ix2505v.c

+ 1 - 1
drivers/media/dvb/frontends/ix2505v.c

@@ -311,7 +311,7 @@ struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
 	return fe;
 	return fe;
 
 
 error:
 error:
-	ix2505v_release(fe);
+	kfree(state);
 	return NULL;
 	return NULL;
 }
 }
 EXPORT_SYMBOL(ix2505v_attach);
 EXPORT_SYMBOL(ix2505v_attach);