提交 d007da1f 编写于 作者: I Ivo van Doorn 提交者: David S. Miller

[RFKILL]: Fix check for correct rfkill allocation

coverity has spotted a bug in rfkill.c (bug id #1627),
in rfkill_allocate() NULL was returns if the kzalloc() works,
and deref the NULL pointer if it fails,
Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c34b19fb
...@@ -296,7 +296,7 @@ struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type) ...@@ -296,7 +296,7 @@ struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type)
struct device *dev; struct device *dev;
rfkill = kzalloc(sizeof(struct rfkill), GFP_KERNEL); rfkill = kzalloc(sizeof(struct rfkill), GFP_KERNEL);
if (rfkill) if (!rfkill)
return NULL; return NULL;
mutex_init(&rfkill->mutex); mutex_init(&rfkill->mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册