Skip to content

Commit d04071a

Browse files
Dan Carpentergregkh
authored andcommitted
vmw_balloon: release lock on error in vmballoon_reset()
We added some locking to this function but forgot to drop the lock on these two error paths. This bug would lead to an immediate deadlock. Fixes: c7b3690 ("vmw_balloon: stats rework") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org Reviewed-by: Nadav Amit <namit@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 32ea33a commit d04071a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/misc/vmw_balloon.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ static void vmballoon_reset(struct vmballoon *b)
12981298
vmballoon_pop(b);
12991299

13001300
if (vmballoon_send_start(b, VMW_BALLOON_CAPABILITIES))
1301-
return;
1301+
goto unlock;
13021302

13031303
if ((b->capabilities & VMW_BALLOON_BATCHED_CMDS) != 0) {
13041304
if (vmballoon_init_batching(b)) {
@@ -1309,7 +1309,7 @@ static void vmballoon_reset(struct vmballoon *b)
13091309
* The guest will retry in one second.
13101310
*/
13111311
vmballoon_send_start(b, 0);
1312-
return;
1312+
goto unlock;
13131313
}
13141314
} else if ((b->capabilities & VMW_BALLOON_BASIC_CMDS) != 0) {
13151315
vmballoon_deinit_batching(b);
@@ -1325,6 +1325,7 @@ static void vmballoon_reset(struct vmballoon *b)
13251325
if (vmballoon_send_guest_id(b))
13261326
pr_err("failed to send guest ID to the host\n");
13271327

1328+
unlock:
13281329
up_write(&b->conf_sem);
13291330
}
13301331

0 commit comments

Comments
 (0)