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

Skip to content
Commit 579c3f3d authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Mayank Rana
Browse files

usb: f_mtp: Check number of iterations before division



If no MTP transfers have taken place and the user checks
MTP status using
	cat /sys/kernel/debug/usb_mtp/status

Then number of iterations will be 0 and a division by
0 (sum/iteration) would happen in debug_mtp_read_stats
resulting in device crash. Fix this by checking if
num of iterations is >0 and only then division; else 0.

Change-Id: I87ba6daac04d1dfb90409f1a2da15e6659976926
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 4d9a308b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment