From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752946AbdKUGMQ (ORCPT ); Tue, 21 Nov 2017 01:12:16 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:33267 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752834AbdKUGMO (ORCPT ); Tue, 21 Nov 2017 01:12:14 -0500 X-IronPort-AV: E=Sophos;i="5.44,432,1505772000"; d="scan'208";a="301713735" Date: Tue, 21 Nov 2017 07:12:11 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Eddie James cc: gregkh@linuxfoundation.org, devicetree@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, bradleyb@fuzziesquirrel.com, cbostic@linux.vnet.ibm.com, joel@jms.id.au, eajames@linux.vnet.ibm.com, "Edward A. James" , kbuild-all@01.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/fsi: sbefifo: fix call_kern.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- 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(-) --- a/drivers/fsi/fsi-sbefifo.c +++ b/drivers/fsi/fsi-sbefifo.c @@ -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);