提交 9b980d95 编写于 作者: T tcharding 提交者: Ulf Hansson

mmc: core: guard dereference of optional parameter

Various functions take as parameter an optional pointer. Pointer
should be guarded with non-NULL check before dereferencing.

Add non-NULL check before dereference of pointer.
Signed-off-by: NTobin C. Harding <me@tobin.cc>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 ce473d5b
......@@ -373,7 +373,8 @@ u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret)
u8 val;
if (!func) {
*err_ret = -EINVAL;
if (err_ret)
*err_ret = -EINVAL;
return 0xFF;
}
......@@ -407,7 +408,8 @@ void sdio_writeb(struct sdio_func *func, u8 b, unsigned int addr, int *err_ret)
int ret;
if (!func) {
*err_ret = -EINVAL;
if (err_ret)
*err_ret = -EINVAL;
return;
}
......@@ -635,7 +637,8 @@ unsigned char sdio_f0_readb(struct sdio_func *func, unsigned int addr,
unsigned char val;
if (!func) {
*err_ret = -EINVAL;
if (err_ret)
*err_ret = -EINVAL;
return 0xFF;
}
......@@ -673,7 +676,8 @@ void sdio_f0_writeb(struct sdio_func *func, unsigned char b, unsigned int addr,
int ret;
if (!func) {
*err_ret = -EINVAL;
if (err_ret)
*err_ret = -EINVAL;
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册