提交 6a6120bc 编写于 作者: C Colin King 提交者: Michael Ellerman

drivers/ps3: Fix ps3-vuart null dereference

On the unlikely event that drv is null, the current code will
perform a null pointer dereference with it when printing a dev_dbg
message.  Instead, the BUG_ON check on drv should be performed
before we emit the dev_dbg message.
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NGeoff Levand <geoff@infradead.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 12a50933
......@@ -1000,12 +1000,11 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
drv = ps3_system_bus_dev_to_vuart_drv(dev);
BUG_ON(!drv);
dev_dbg(&dev->core, "%s:%d: (%s)\n", __func__, __LINE__,
drv->core.core.name);
BUG_ON(!drv);
if (dev->port_number >= PORT_COUNT) {
BUG();
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册