msm: rpm-smd: Remove BUG if packet size is 0
When a interrupt for data event is received, it is possible that the SMD
packet could have been processed on other core executing with interrupts
locked. In this case, the data event would have scheduled a workqueue
which would result in 0 bytes for packet size. This is a valid scenario
and shouldn't throw a bug.
Change-Id: I8cdb411491e1b344356bae7071ec65342e456655
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
diff --git a/arch/arm/mach-msm/rpm-smd.c b/arch/arm/mach-msm/rpm-smd.c
index cd5556a..b112c90 100644
--- a/arch/arm/mach-msm/rpm-smd.c
+++ b/arch/arm/mach-msm/rpm-smd.c
@@ -490,13 +490,14 @@
pkt_sz = smd_cur_packet_size(msm_rpm_data.ch_info);
+ if (!pkt_sz)
+ return -EAGAIN;
+
BUG_ON(pkt_sz > MAX_ERR_BUFFER_SIZE);
if (pkt_sz != smd_read_avail(msm_rpm_data.ch_info))
return -EAGAIN;
- BUG_ON(pkt_sz == 0);
-
do {
int len;