Skip to content

Commit

Permalink
video: sh_mobile_lcdcfb: Delete an error message for a failed memory …
Browse files Browse the repository at this point in the history
…allocation in two functions

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Cc: Arvind Yadav <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Wei Yongjun <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
elfring authored and bzolnier committed Apr 26, 2018
1 parent bdb488e commit e281018
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/video/fbdev/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2149,10 +2149,8 @@ sh_mobile_lcdc_channel_fb_register(struct sh_mobile_lcdc_chan *ch)
if (info->fbdefio) {
ch->sglist = vmalloc(sizeof(struct scatterlist) *
ch->fb_size >> PAGE_SHIFT);
if (!ch->sglist) {
dev_err(ch->lcdc->dev, "cannot allocate sglist\n");
if (!ch->sglist)
return -ENOMEM;
}
}

info->bl_dev = ch->bl;
Expand Down Expand Up @@ -2716,10 +2714,8 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
}

priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
dev_err(&pdev->dev, "cannot allocate device data\n");
if (!priv)
return -ENOMEM;
}

priv->dev = &pdev->dev;
priv->meram_dev = pdata->meram_dev;
Expand Down

0 comments on commit e281018

Please sign in to comment.