mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marvin Lin <milkfafa@gmail.com>
To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl
Cc: dan.carpenter@linaro.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org,
	avifishman70@gmail.com, tmaimon77@gmail.com, kwliu@nuvoton.com,
	kflin@nuvoton.com, Marvin Lin <milkfafa@gmail.com>
Subject: [PATCH] media: nuvoton: npcm-video: Fix sleeping in atomic context
Date: Tue,  3 Oct 2023 15:55:12 +0800	[thread overview]
Message-ID: <20231003075512.2081141-1-milkfafa@gmail.com> (raw)

Fix sleeping in atomic context warnings reported by the Smatch static
analysis tool. Use GFP_ATOMIC instead of GFP_KERNEL in atomic context.

Fixes: 70721089985c ("media: nuvoton: Add driver for NPCM video capture and encoding engine")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Marvin Lin <milkfafa@gmail.com>
---
 drivers/media/platform/nuvoton/npcm-video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c
index ac8d73b794d3..5d160978f7b3 100644
--- a/drivers/media/platform/nuvoton/npcm-video.c
+++ b/drivers/media/platform/nuvoton/npcm-video.c
@@ -412,7 +412,7 @@ static unsigned int npcm_video_add_rect(struct npcm_video *video,
 	struct rect_list *list = NULL;
 	struct v4l2_rect *r;
 
-	list = kzalloc(sizeof(*list), GFP_KERNEL);
+	list = kzalloc(sizeof(*list), GFP_ATOMIC);
 	if (!list)
 		return 0;
 
@@ -467,7 +467,7 @@ static struct rect_list *npcm_video_new_rect(struct npcm_video *video,
 	struct rect_list *list = NULL;
 	struct v4l2_rect *r;
 
-	list = kzalloc(sizeof(*list), GFP_KERNEL);
+	list = kzalloc(sizeof(*list), GFP_ATOMIC);
 	if (!list)
 		return NULL;
 
-- 
2.34.1


             reply	other threads:[~2023-10-03  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03  7:55 Marvin Lin [this message]
2023-10-03 13:23 ` Hans Verkuil
2023-10-10 12:30   ` Kun-Fa Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003075512.2081141-1-milkfafa@gmail.com \
    --to=milkfafa@gmail.com \
    --cc=avifishman70@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kflin@nuvoton.com \
    --cc=kwliu@nuvoton.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=tmaimon77@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®