Skip to contentSkip to conversation

drivers/fsi: sbefifo: fix call_kern.cocci warnings

PATCH New Julia Lawall 1 participant 1 message Nov 21, 2017 FSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/fsi: sbefifo: fix call_kern.cocci warnings

Function sbefifo_enq_xfr called inside lock from sbefifo_write_common but uses GFP_KERNEL. Change to GFP_ATOMIC.

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

Fixes 0f8664fbfc9f ("drivers/fsi: sbefifo: Add miscdevice")
CC Edward A. James <eajames-r/[email protected]>

---

Semantic patch information:
The proposed change of converting the GFP_KERNEL is not necessarily the correct one. It may be desired to unlock the lock, or to not call the function under the lock in the first place.

 fsi-sbefifo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-sbefifo.c +1 -1
@@ -266,7 +266,7 @@ static struct sbefifo_xfr *sbefifo_enq_x
 	if (READ_ONCE(sbefifo->rc))
 		return ERR_PTR(sbefifo->rc);
 
-	xfr = kzalloc(sizeof(*xfr), GFP_KERNEL);
+	xfr = kzalloc(sizeof(*xfr), GFP_ATOMIC);
 	if (!xfr)
 		return ERR_PTR(-ENOMEM);
 

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