All of lore.kernel.org
 help / color / mirror / Atom feed
* [chrome-os:chromeos-5.4 34/43] drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure
@ 2020-03-18 20:19 kbuild test robot
  2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: kbuild test robot @ 2020-03-18 20:19 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head:   4ab03425ee573fd6b97746d319f2c88b465a1534
commit: bbca48582a7342c1201691ce0eb08f1538376538 [34/43] BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure
   drivers/media/virtio/virtio_video_caps.c:380:5-11: ERROR: allocation function on line 379 returns NULL not ERR_PTR on failure
--
>> drivers/media/virtio/virtio_video_driver.c:103:5-11: ERROR: allocation function on line 102 returns NULL not ERR_PTR on failure
--
>> drivers/media/virtio/virtio_video_vq.c:92:8-24: WARNING: kmem_cache_zalloc should be used for vbuf, instead of kmem_cache_alloc/memset

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings
  2020-03-18 20:19 [chrome-os:chromeos-5.4 34/43] drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure kbuild test robot
@ 2020-03-18 20:19 ` kbuild test robot
  2020-03-18 20:19 ` kbuild test robot
  2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix zalloc-simple.cocci warnings kbuild test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-03-18 20:19 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]

From: kbuild test robot <lkp@intel.com>

drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure
drivers/media/virtio/virtio_video_caps.c:380:5-11: ERROR: allocation function on line 379 returns NULL not ERR_PTR on failure

 The various basic memory allocation functions don't return ERR_PTR

Generated by: scripts/coccinelle/null/eno.cocci

Fixes: bbca48582a73 ("BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver")
CC: Dmitry Sepp <dmitry.sepp@opensynergy.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head:   4ab03425ee573fd6b97746d319f2c88b465a1534
commit: bbca48582a7342c1201691ce0eb08f1538376538 [34/43] BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver

 virtio_video_caps.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/media/virtio/virtio_video_caps.c
+++ b/drivers/media/virtio/virtio_video_caps.c
@@ -295,7 +295,7 @@ static int virtio_video_parse_control_le
 	virtio_format = virtio_video_v4l2_format_to_virtio(fmt->format);
 
 	resp_buf = kzalloc(resp_size, GFP_KERNEL);
-	if (IS_ERR(resp_buf)) {
+	if (!resp_buf) {
 		ret = PTR_ERR(resp_buf);
 		goto err;
 	}
@@ -377,7 +377,7 @@ static int virtio_video_parse_control_pr
 	resp_size = vv->max_resp_len;
 	virtio_format = virtio_video_v4l2_format_to_virtio(fmt->format);
 	resp_buf = kzalloc(resp_size, GFP_KERNEL);
-	if (IS_ERR(resp_buf)) {
+	if (!resp_buf) {
 		ret = PTR_ERR(resp_buf);
 		goto err;
 	}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings
  2020-03-18 20:19 [chrome-os:chromeos-5.4 34/43] drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure kbuild test robot
  2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings kbuild test robot
@ 2020-03-18 20:19 ` kbuild test robot
  2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix zalloc-simple.cocci warnings kbuild test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-03-18 20:19 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

From: kbuild test robot <lkp@intel.com>

drivers/media/virtio/virtio_video_driver.c:103:5-11: ERROR: allocation function on line 102 returns NULL not ERR_PTR on failure

 The various basic memory allocation functions don't return ERR_PTR

Generated by: scripts/coccinelle/null/eno.cocci

Fixes: bbca48582a73 ("BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver")
CC: Dmitry Sepp <dmitry.sepp@opensynergy.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head:   4ab03425ee573fd6b97746d319f2c88b465a1534
commit: bbca48582a7342c1201691ce0eb08f1538376538 [34/43] BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver

 virtio_video_driver.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/virtio/virtio_video_driver.c
+++ b/drivers/media/virtio/virtio_video_driver.c
@@ -100,7 +100,7 @@ static int virtio_video_query_cap_resp_b
 	int resp_size = vv->max_caps_len;
 
 	*resp_buf = kzalloc(vv->max_caps_len, GFP_KERNEL);
-	if (IS_ERR(*resp_buf)) {
+	if (!*resp_buf) {
 		ret = PTR_ERR(*resp_buf);
 		goto err;
 	}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] BACKPORT: FROMLIST: virtio_video: fix zalloc-simple.cocci warnings
  2020-03-18 20:19 [chrome-os:chromeos-5.4 34/43] drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure kbuild test robot
  2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings kbuild test robot
  2020-03-18 20:19 ` kbuild test robot
@ 2020-03-18 20:19 ` kbuild test robot
  2 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-03-18 20:19 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]

From: kbuild test robot <lkp@intel.com>

drivers/media/virtio/virtio_video_vq.c:92:8-24: WARNING: kmem_cache_zalloc should be used for vbuf, instead of kmem_cache_alloc/memset


 Use zeroing allocator rather than allocator followed by memset with 0

 This considers some simple cases that are common and easy to validate
 Note in particular that there are no ...s in the rule, so all of the
 matched code has to be contiguous

Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci

Fixes: bbca48582a73 ("BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver")
CC: Dmitry Sepp <dmitry.sepp@opensynergy.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head:   4ab03425ee573fd6b97746d319f2c88b465a1534
commit: bbca48582a7342c1201691ce0eb08f1538376538 [34/43] BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver

Please take the patch only if it's a positive warning. Thanks!

 virtio_video_vq.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/media/virtio/virtio_video_vq.c
+++ b/drivers/media/virtio/virtio_video_vq.c
@@ -89,10 +89,9 @@ virtio_video_get_vbuf(struct virtio_vide
 {
 	struct virtio_video_vbuffer *vbuf;
 
-	vbuf = kmem_cache_alloc(vv->vbufs, GFP_KERNEL);
+	vbuf = kmem_cache_zalloc(vv->vbufs, GFP_KERNEL);
 	if (!vbuf)
 		return ERR_PTR(-ENOMEM);
-	memset(vbuf, 0, VBUFFER_SIZE);
 
 	BUG_ON(size > MAX_INLINE_CMD_SIZE);
 	vbuf->buf = (void *)vbuf + sizeof(*vbuf);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings
  2020-04-07  0:24 [chrome-os:chromeos-5.4 34/57] drivers/media/virtio/virtio_video_driver.c:103:5-11: ERROR: allocation function on line 102 returns NULL not ERR_PTR on failure kbuild test robot
@ 2020-04-07  0:25 ` kbuild test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-04-07  0:25 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

From: kbuild test robot <lkp@intel.com>

drivers/media/virtio/virtio_video_driver.c:103:5-11: ERROR: allocation function on line 102 returns NULL not ERR_PTR on failure

 The various basic memory allocation functions don't return ERR_PTR

Generated by: scripts/coccinelle/null/eno.cocci

Fixes: bbca48582a73 ("BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver")
CC: Dmitry Sepp <dmitry.sepp@opensynergy.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head:   9d43dae2e392875899bd5387f80bfc6ee35b162f
commit: bbca48582a7342c1201691ce0eb08f1538376538 [34/57] BACKPORT: FROMLIST: virtio_video: Add the Virtio Video V4L2 driver

 virtio_video_driver.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/virtio/virtio_video_driver.c
+++ b/drivers/media/virtio/virtio_video_driver.c
@@ -100,7 +100,7 @@ static int virtio_video_query_cap_resp_b
 	int resp_size = vv->max_caps_len;
 
 	*resp_buf = kzalloc(vv->max_caps_len, GFP_KERNEL);
-	if (IS_ERR(*resp_buf)) {
+	if (!*resp_buf) {
 		ret = PTR_ERR(*resp_buf);
 		goto err;
 	}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-07  0:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-18 20:19 [chrome-os:chromeos-5.4 34/43] drivers/media/virtio/virtio_video_caps.c:298:5-11: ERROR: allocation function on line 297 returns NULL not ERR_PTR on failure kbuild test robot
2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings kbuild test robot
2020-03-18 20:19 ` kbuild test robot
2020-03-18 20:19 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix zalloc-simple.cocci warnings kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-04-07  0:24 [chrome-os:chromeos-5.4 34/57] drivers/media/virtio/virtio_video_driver.c:103:5-11: ERROR: allocation function on line 102 returns NULL not ERR_PTR on failure kbuild test robot
2020-04-07  0:25 ` [PATCH] BACKPORT: FROMLIST: virtio_video: fix eno.cocci warnings kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.