* [drm-intel:drm-intel-next-queued 6/7] drivers/gpu/drm/i915/display/intel_color.c:1576 ilk_read_lut_10() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
@ 2019-09-20 17:55 kbuild test robot
2019-09-20 18:13 ` Ville Syrjälä
0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2019-09-20 17:55 UTC (permalink / raw)
To: Swati Sharma; +Cc: Jani Nikula, intel-gfx, kbuild-all, dri-devel
tree: git://anongit.freedesktop.org/drm-intel drm-intel-next-queued
head: 4bb6a9d5d9a8289673c4cb0786d44be8a63c21db
commit: 6b97b118d4d542c7bc25b725c6de3947fffb921b [6/7] drm/i915/display: Extract ilk_read_luts()
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
New smatch warnings:
drivers/gpu/drm/i915/display/intel_color.c:1576 ilk_read_lut_10() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
Old smatch warnings:
drivers/gpu/drm/i915/display/intel_color.c:1535 i9xx_read_lut_8() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
vim +/blob +1576 drivers/gpu/drm/i915/display/intel_color.c
1558
1559 static struct drm_property_blob *
1560 ilk_read_lut_10(const struct intel_crtc_state *crtc_state)
1561 {
1562 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
1563 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
1564 u32 lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
1565 enum pipe pipe = crtc->pipe;
1566 struct drm_property_blob *blob;
1567 struct drm_color_lut *blob_data;
1568 u32 i, val;
1569
1570 blob = drm_property_create_blob(&dev_priv->drm,
1571 sizeof(struct drm_color_lut) * lut_size,
1572 NULL);
1573 if (IS_ERR(blob))
1574 return NULL;
1575
> 1576 blob_data = blob->data;
1577
1578 for (i = 0; i < lut_size; i++) {
1579 val = I915_READ(PREC_PALETTE(pipe, i));
1580
1581 blob_data[i].red = intel_color_lut_pack(REG_FIELD_GET(
1582 PREC_PALETTE_RED_MASK, val), 10);
1583 blob_data[i].green = intel_color_lut_pack(REG_FIELD_GET(
1584 PREC_PALETTE_GREEN_MASK, val), 10);
1585 blob_data[i].blue = intel_color_lut_pack(REG_FIELD_GET(
1586 PREC_PALETTE_BLUE_MASK, val), 10);
1587 }
1588
1589 return blob;
1590 }
1591
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [drm-intel:drm-intel-next-queued 6/7] drivers/gpu/drm/i915/display/intel_color.c:1576 ilk_read_lut_10() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
2019-09-20 17:55 [drm-intel:drm-intel-next-queued 6/7] drivers/gpu/drm/i915/display/intel_color.c:1576 ilk_read_lut_10() error: potential null dereference 'blob'. (drm_property_create_blob returns null) kbuild test robot
@ 2019-09-20 18:13 ` Ville Syrjälä
0 siblings, 0 replies; 2+ messages in thread
From: Ville Syrjälä @ 2019-09-20 18:13 UTC (permalink / raw)
To: kbuild test robot; +Cc: Jani Nikula, intel-gfx, dri-devel, kbuild-all
On Sat, Sep 21, 2019 at 01:55:25AM +0800, kbuild test robot wrote:
> tree: git://anongit.freedesktop.org/drm-intel drm-intel-next-queued
> head: 4bb6a9d5d9a8289673c4cb0786d44be8a63c21db
> commit: 6b97b118d4d542c7bc25b725c6de3947fffb921b [6/7] drm/i915/display: Extract ilk_read_luts()
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
>
> New smatch warnings:
> drivers/gpu/drm/i915/display/intel_color.c:1576 ilk_read_lut_10() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
It never returns null. Not sure why this thing thinks otherwise.
>
> Old smatch warnings:
> drivers/gpu/drm/i915/display/intel_color.c:1535 i9xx_read_lut_8() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
>
> vim +/blob +1576 drivers/gpu/drm/i915/display/intel_color.c
>
> 1558
> 1559 static struct drm_property_blob *
> 1560 ilk_read_lut_10(const struct intel_crtc_state *crtc_state)
> 1561 {
> 1562 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
> 1563 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> 1564 u32 lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
> 1565 enum pipe pipe = crtc->pipe;
> 1566 struct drm_property_blob *blob;
> 1567 struct drm_color_lut *blob_data;
> 1568 u32 i, val;
> 1569
> 1570 blob = drm_property_create_blob(&dev_priv->drm,
> 1571 sizeof(struct drm_color_lut) * lut_size,
> 1572 NULL);
> 1573 if (IS_ERR(blob))
> 1574 return NULL;
> 1575
> > 1576 blob_data = blob->data;
> 1577
> 1578 for (i = 0; i < lut_size; i++) {
> 1579 val = I915_READ(PREC_PALETTE(pipe, i));
> 1580
> 1581 blob_data[i].red = intel_color_lut_pack(REG_FIELD_GET(
> 1582 PREC_PALETTE_RED_MASK, val), 10);
> 1583 blob_data[i].green = intel_color_lut_pack(REG_FIELD_GET(
> 1584 PREC_PALETTE_GREEN_MASK, val), 10);
> 1585 blob_data[i].blue = intel_color_lut_pack(REG_FIELD_GET(
> 1586 PREC_PALETTE_BLUE_MASK, val), 10);
> 1587 }
> 1588
> 1589 return blob;
> 1590 }
> 1591
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-20 18:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-20 17:55 [drm-intel:drm-intel-next-queued 6/7] drivers/gpu/drm/i915/display/intel_color.c:1576 ilk_read_lut_10() error: potential null dereference 'blob'. (drm_property_create_blob returns null) kbuild test robot
2019-09-20 18:13 ` Ville Syrjälä
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.