Skip to content

Commit

Permalink
p8-i2c OCC lock: fix locking in p9_i2c_bus_owner_change
Browse files Browse the repository at this point in the history
Fixes: c5fa0d7
Reported-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
stewartsmith committed Jun 7, 2017
1 parent 05b8834 commit 8552222
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hw/p8-i2c.c
@@ -1,4 +1,4 @@
/* Copyright 2013-2014 IBM Corp.
/* Copyright 2013-2017 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1293,8 +1293,10 @@ void p9_i2c_bus_owner_change(u32 chip_id)

/* Can we now lock this master? */
rc = occ_i2c_lock(master);
if (rc)
if (rc) {
unlock(&master->lock);
continue;
}

/* Run the state machine */
p8_i2c_check_status(master);
Expand Down

0 comments on commit 8552222

Please sign in to comment.