lkml.org 
[lkml]   [2023]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] media: nuvoton: npcm-video: Fix sleeping in atomic context
    Date
    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
    \
     
     \ /
      Last update: 2023-10-03 09:56    [W:2.852 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site