Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e908f62 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 237d4a7e 4ac2a50d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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,