Function handle_request called from bt_i2c_slave_cb with bt_slave->lock
held but uses GFP_KERNEL.  Replace GFP_KERNEL by GFP_ATOMIC.

Generated by: scripts/coccinelle/locks/call_kern.cocci

Fixes: acd0208e3557 ("ipmi: bt-i2c: added IPMI Block Transfer over I2C BMC 
CC: Brendan Higgins <>
Signed-off-by: Julia Lawall <>
Signed-off-by: Fengguang Wu <>


 ipmi_bmc_bt_i2c.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/char/ipmi_bmc/ipmi_bmc_bt_i2c.c
+++ b/drivers/char/ipmi_bmc/ipmi_bmc_bt_i2c.c
@@ -201,7 +201,7 @@ static int handle_request(struct bt_i2c_

        if (atomic_read(&bt_slave->request_queue_len) >= request_queue_max_len)
                return -EFAULT;
-       queue_elem = kmalloc(sizeof(*queue_elem), GFP_KERNEL);
+       queue_elem = kmalloc(sizeof(*queue_elem), GFP_ATOMIC);
        if (!queue_elem)
                return -ENOMEM;
        memcpy(&queue_elem->request, &bt_slave->request, sizeof(struct bt_msg));

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Openipmi-developer mailing list

Reply via email to