Merge "mhi: core: Do a null pointer check before reading debug registers"

This commit is contained in:
qctecmdr 2020-06-05 07:04:35 -07:00 committed by Gerrit - the friendly Code Review server
commit 5e908f6261

View file

@ -2776,7 +2776,7 @@ void mhi_debug_reg_dump(struct mhi_controller *mhi_cntrl)
struct {
const char *name;
int offset;
void *base;
void __iomem *base;
} debug_reg[] = {
{ "MHI_CNTRL", MHICTRL, mhi_base},
{ "MHI_STATUS", MHISTATUS, mhi_base},
@ -2806,6 +2806,8 @@ void mhi_debug_reg_dump(struct mhi_controller *mhi_cntrl)
TO_MHI_STATE_STR(state));
for (i = 0; debug_reg[i].name; i++) {
if (!debug_reg[i].base)
continue;
ret = mhi_read_reg(mhi_cntrl, debug_reg[i].base,
debug_reg[i].offset, &val);
MHI_LOG("reg:%s val:0x%x, ret:%d\n", debug_reg[i].name, val,