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

Commit cc635188 authored by Sreelakshmi Gownipalli's avatar Sreelakshmi Gownipalli Committed by Gerrit - the friendly Code Review server
Browse files

diag: Check if usb is connected while allocating usb requests



In usb_connect() check whether the usb is connected before allocating
any usb read and write requests.

Change-Id: I3873dd2b5e98d9e9adbdf0cff3e0a5b0399f620d
Signed-off-by: default avatarSreelakshmi Gownipalli <sgownipa@codeaurora.org>
parent adb479c0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -105,7 +105,7 @@ static void usb_connect(struct diag_usb_info *ch)
	int num_write = 0;
	int num_read = 1; /* Only one read buffer for any USB channel */

	if (!ch)
	if (!ch || !ch->connected)
		return;

	num_write = diag_mempools[ch->mempool].poolsize;