Skip to contentSkip to conversation

video: mmp: delete a stray mutex_unlock()

PATCH In review Dan Carpenter 3 participants 4 messages Nov 14, 2013 – Jan 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 video: mmp: delete a stray mutex_unlock()

We aren't holding the disp_lock so we shouldn't release it.

drivers/video/mmp/core.c +1 -6
index 84de263..c8d4265 100644
@@ -173,7 +173,7 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 		+ sizeof(struct mmp_overlay) * info->overlay_num;
 	path = kzalloc(size, GFP_KERNEL);
 	if (!path)
-		goto failed;
+		return NULL;
 
 	/* path set */
 	mutex_init(&path->access_ok);
@@ -219,11 +219,6 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 
 	mutex_unlock(&disp_lock);
 	return path;
-
-failed:
-	kfree(path);
-	mutex_unlock(&disp_lock);
-	return NULL;
 }
 EXPORT_SYMBOL_GPL(mmp_register_path);
 
#1 lore raw

Ping.

regards,
dan carpenter

Quoted 33 lines · Dan Carpenter

We aren't holding the disp_lock so we shouldn't release it.

drivers/video/mmp/core.c +1 -7
index 84de263..c8d4265 100644
@@ -173,7 +173,7 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 		+ sizeof(struct mmp_overlay) * info->overlay_num;
 	path = kzalloc(size, GFP_KERNEL);
 	if (!path)
-		goto failed;
+		return NULL;
 
 	/* path set */
 	mutex_init(&path->access_ok);
@@ -219,11 +219,6 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 
 	mutex_unlock(&disp_lock);
 	return path;
-
-failed:
-	kfree(path);
-	mutex_unlock(&disp_lock);
-	return NULL;
 }
 EXPORT_SYMBOL_GPL(mmp_register_path);
 
--

To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 1/2
#2 lore raw
In reply to Dan Carpenter
Quoted 35 lines · Dan Carpenter

Ping.

regards,
dan carpenter

Quoted 29 lines · Dan Carpenter

We aren't holding the disp_lock so we shouldn't release it.

drivers/video/mmp/core.c +1 -6
index 84de263..c8d4265 100644
@@ -173,7 +173,7 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
  		+ sizeof(struct mmp_overlay) * info->overlay_num;
  	path = kzalloc(size, GFP_KERNEL);
  	if (!path)
-		goto failed;
+		return NULL;
 
  	/* path set */
  	mutex_init(&path->access_ok);
@@ -219,11 +219,6 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 
  	mutex_unlock(&disp_lock);
  	return path;
-
-failed:
-	kfree(path);
-	mutex_unlock(&disp_lock);
-	return NULL;
  }
  EXPORT_SYMBOL_GPL(mmp_register_path);
 
Quoted 4 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Jean,
Could you help to merge this fix?

Regards
Haojian

#3 lore raw
In reply to Dan Carpenter
Quoted 20 lines · Dan Carpenter

We aren't holding the disp_lock so we shouldn't release it.

drivers/video/mmp/core.c +1 -1
index 84de263..c8d4265 100644
@@ -173,7 +173,7 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 		+ sizeof(struct mmp_overlay) * info->overlay_num;
 	path = kzalloc(size, GFP_KERNEL);
 	if (!path)
-		goto failed;
+		return NULL;
 
 	/* path set */
 	mutex_init(&path->access_ok);
@@ -219,11 +219,6 @@ struct mmp_path *mmp_register_path(struct mmp_path_info *info)
 

drivers/video/mmp/core.c struct mmp_path *mmp_register_path(struct mmp_path_info *info) · line 224

Quoted 10 lines
drivers/video/mmp/core.c +0 -5
 	mutex_unlock(&disp_lock);
 	return path;
-
-failed:
-	kfree(path);
-	mutex_unlock(&disp_lock);
-	return NULL;
 }
 EXPORT_SYMBOL_GPL(mmp_register_path);
 

Queued for 3.14.

Tomi