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

Commit 81f7fda2 authored by Andrei Danaila's avatar Andrei Danaila Committed by Matt Wagantall
Browse files

mhi: rmnet: Enabled sanity check for LPM IOCTL



Enabled sanity check for LPM IOCTL in MHI. IOCTL should not
be called into MHI, if the device is not ready.

CRs-Fixed: 749894
Change-Id: I52627a94e70e3b17130653b7b73a86b417807842
Signed-off-by: default avatarAndrei Danaila <adanaila@codeaurora.org>
parent 0a9eaddf
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -691,7 +691,15 @@ static int rmnet_mhi_ioctl_extended(struct net_device *dev, struct ifreq *ifr)
			sizeof(ext_cmd.u.if_name));
		break;
	case RMNET_IOCTL_SET_SLEEP_STATE:
		mhi_set_lpm(rmnet_mhi_ptr->tx_client_handle, ext_cmd.u.data);
		if (rmnet_mhi_ptr->mhi_enabled &&
		    rmnet_mhi_ptr->tx_client_handle != NULL) {
			mhi_set_lpm(rmnet_mhi_ptr->tx_client_handle,
				   ext_cmd.u.data);
		} else {
			rmnet_log(MSG_ERROR,
				  "Cannot set LPM value, MHI is not up.\n");
			return -ENODEV;
		}
		break;
	default:
		rc = -EINVAL;