usb: gadget: u_ether: Check if cable is connected before get and set MRU
In rmnet_extended_ioctl() for RMNET_IOCTL_SET_MRU and
RMNET_IOCTL_GET_MRU ioctls, check if the cable is connected or not
before setting and getting MRU values respectively. If cable is not
connected, then gether port will not exist and it will lead to NULL
pointer exception when trying to access it's members.
So, check if the gether port exists and only then access it's
members else return ENODEV.
CRs-fixed: 720409
Change-Id: I9e0f5c9a07a1c55f5c1e9c3b3b29982569124a11
Signed-off-by:
Azhar Shaikh <azhars@codeaurora.org>
Loading
Please register or sign in to comment