From: Jia-Ju Bai Date: Fri, 27 Jul 2018 03:44:24 +0000 (-0400) Subject: media: pci: ivtv: Replace GFP_ATOMIC with GFP_KERNEL X-Git-Tag: android-x86-8.1-r1~474^2~137 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5bfffa0c86915e5afbfe56d9790457b2a9887f2d;p=android-x86%2Fkernel.git media: pci: ivtv: Replace GFP_ATOMIC with GFP_KERNEL ivtv_probe() and ivtvfb_init_card() are never called in atomic context. They call kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 6b2ffdc96961..dd727098daf4 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -999,7 +999,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) int vbi_buf_size; struct ivtv *itv; - itv = kzalloc(sizeof(struct ivtv), GFP_ATOMIC); + itv = kzalloc(sizeof(struct ivtv), GFP_KERNEL); if (itv == NULL) return -ENOMEM; itv->pdev = pdev; diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index b19058e36853..5ddaa8ed11a5 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c @@ -1178,7 +1178,7 @@ static int ivtvfb_init_card(struct ivtv *itv) } itv->osd_info = kzalloc(sizeof(struct osd_info), - GFP_ATOMIC|__GFP_NOWARN); + GFP_KERNEL|__GFP_NOWARN); if (itv->osd_info == NULL) { IVTVFB_ERR("Failed to allocate memory for osd_info\n"); return -ENOMEM;