mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 20:19:50 +00:00 
			
		
		
		
	Added a new patch to the 4.11 and 4.9 kernels based on a patch submitted to stable: https://patchwork.kernel.org/patch/9829039/ This patch fixes a off-by-one error in the VMBus code. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 32ec586052699938458ad07ac8dc50a168896b2e Mon Sep 17 00:00:00 2001
 | |
| From: "K. Y. Srinivasan" <kys@microsoft.com>
 | |
| Date: Mon, 14 Dec 2015 16:01:44 -0800
 | |
| Subject: [PATCH 18/44] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing
 | |
|  GUIDs
 | |
| 
 | |
| Use uuid_le_cmp() for comparing GUIDs.
 | |
| 
 | |
| Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
 | |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 | |
| (cherry picked from commit 4ae9250893485f380275e7d5cb291df87c4d9710)
 | |
| ---
 | |
|  drivers/hv/channel_mgmt.c | 3 +--
 | |
|  drivers/hv/vmbus_drv.c    | 4 ++--
 | |
|  2 files changed, 3 insertions(+), 4 deletions(-)
 | |
| 
 | |
| diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
 | |
| index 339277b76468..9b4525c56376 100644
 | |
| --- a/drivers/hv/channel_mgmt.c
 | |
| +++ b/drivers/hv/channel_mgmt.c
 | |
| @@ -409,8 +409,7 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
 | |
|  	struct cpumask *alloced_mask;
 | |
|  
 | |
|  	for (i = IDE; i < MAX_PERF_CHN; i++) {
 | |
| -		if (!memcmp(type_guid->b, &hp_devs[i].guid,
 | |
| -				 sizeof(uuid_le))) {
 | |
| +		if (!uuid_le_cmp(*type_guid, hp_devs[i].guid)) {
 | |
|  			perf_chn = true;
 | |
|  			break;
 | |
|  		}
 | |
| diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
 | |
| index f1fbb6b98f5c..e71f3561dbab 100644
 | |
| --- a/drivers/hv/vmbus_drv.c
 | |
| +++ b/drivers/hv/vmbus_drv.c
 | |
| @@ -535,7 +535,7 @@ static const uuid_le null_guid;
 | |
|  
 | |
|  static inline bool is_null_guid(const uuid_le *guid)
 | |
|  {
 | |
| -	if (memcmp(guid, &null_guid, sizeof(uuid_le)))
 | |
| +	if (uuid_le_cmp(*guid, null_guid))
 | |
|  		return false;
 | |
|  	return true;
 | |
|  }
 | |
| @@ -549,7 +549,7 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(
 | |
|  					const uuid_le *guid)
 | |
|  {
 | |
|  	for (; !is_null_guid(&id->guid); id++)
 | |
| -		if (!memcmp(&id->guid, guid, sizeof(uuid_le)))
 | |
| +		if (!uuid_le_cmp(id->guid, *guid))
 | |
|  			return id;
 | |
|  
 | |
|  	return NULL;
 | |
| -- 
 | |
| 2.13.0
 | |
| 
 |