linux_dsm_epyc7002/drivers/gpu/drm
Takashi Iwai d8e9b2b909 drm/i915/gvt: Fix superfluous newline in GVT_DISPLAY_READY env var
send_display_send_uevent() sends two environment variable, and the
first one GVT_DISPLAY_READY is set including a new line at the end of
the string; that is obviously superfluous and wrong -- at least, it
*looks* so when you only read the code.

However, it doesn't appear in the actual output by a (supposedly
unexpected) trick.  The code uses snprintf() and truncates the string
in size 20 bytes.  This makes the string as GVT_DISPLAY_READY=0 or
...=1 including the trailing NUL-letter.  That is, the '\n' found in
the format string is always cut off as a result.

Although the code gives the correct result, it is confusing.  This
patch addresses it, just removing the superfluous '\n' from the format
string for avoiding further confusion.  If the argument "ready" were
not a  bool, the size 20 should be corrected as well.  But it's a
bool, so we can leave the magic number 20 as is for now.

FWIW, the bug was spotted by a new GCC7 warning:
  drivers/gpu/drm/i915/gvt/handlers.c: In function 'pvinfo_mmio_write':
  drivers/gpu/drm/i915/gvt/handlers.c:1042:34: error: 'snprintf' output truncated before the last format character [-Werror=format-truncation=]
    snprintf(display_ready_str, 20, "GVT_DISPLAY_READY=%d\n", ready);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/gvt/handlers.c:1042:2: note: 'snprintf' output 21 bytes into a destination of size 20
    snprintf(display_ready_str, 20, "GVT_DISPLAY_READY=%d\n", ready);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 04d348ae3f ("drm/i915/gvt: vGPU display virtualization")
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1025903
Reported-by: Richard Biener <rguenther@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2017-02-23 17:32:14 +08:00
..
amd Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
arc drm: bridge: Link encoder and bridge in core code 2016-12-18 16:31:45 +05:30
arm Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
armada drm: add more MMU dependencies 2017-01-11 17:24:58 +01:00
ast drm/ttm: revert "implement LRU add callbacks v2" 2017-01-27 12:20:34 -05:00
atmel-hlcdc Contains a single patch to create the fbdev at driver's registration 2017-02-01 08:30:19 +10:00
bochs drm/ttm: revert "implement LRU add callbacks v2" 2017-01-27 12:20:34 -05:00
bridge Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
cirrus drm/ttm: revert "implement LRU add callbacks v2" 2017-01-27 12:20:34 -05:00
etnaviv Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
exynos Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next 2017-02-01 08:43:42 +10:00
fsl-dcu drm: Change the return type of the unload hook to void 2017-01-09 11:25:22 +01:00
gma500 drm/gma500: Nuke device_is_agp callback 2017-01-25 16:33:26 +01:00
hisilicon Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
i2c
i810 drm/i810: drop device_is_agp callback 2017-01-26 10:44:43 +01:00
i915 drm/i915/gvt: Fix superfluous newline in GVT_DISPLAY_READY env var 2017-02-23 17:32:14 +08:00
imx drm: bridge: dw-hdmi: Move IRQ and IO resource allocation to common code 2017-01-18 09:29:32 +05:30
lib drm: Add a simple generator of random permutations 2016-12-27 12:34:00 +01:00
mediatek drm: mediatek: use crtc helper drm_crtc_from_index() 2017-01-18 09:21:06 -05:00
meson Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
mga drm/mga: remove device_is_agp callback 2017-01-26 10:45:03 +01:00
mgag200 drm/ttm: revert "implement LRU add callbacks v2" 2017-01-27 12:20:34 -05:00
msm Merge tag 'drm-misc-next-2017-01-23' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-01-27 12:10:24 +10:00
mxsfb drm: Nuke fb->pixel_format 2016-12-15 14:55:34 +02:00
nouveau Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
omapdrm Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
panel drm/panel: simple: Add support for AUO G185HAN01 2016-12-06 17:06:32 +01:00
qxl drm/ttm: revert "implement LRU add callbacks v2" 2017-01-27 12:20:34 -05:00
r128
radeon Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
rcar-du drm: bridge: Link encoder and bridge in core code 2016-12-18 16:31:45 +05:30
rockchip drm: bridge: dw-hdmi: Move IRQ and IO resource allocation to common code 2017-01-18 09:29:32 +05:30
savage drm: Change the return type of the unload hook to void 2017-01-09 11:25:22 +01:00
selftests drm: Fix error handling in drm_mm eviction kselftest 2017-01-11 08:53:34 +01:00
shmobile drm: Change the return type of the unload hook to void 2017-01-09 11:25:22 +01:00
sis drm: Change the return type of the unload hook to void 2017-01-09 11:25:22 +01:00
sti Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
sun4i Allwinner DRM changes for 4.11 2017-02-01 08:43:19 +10:00
tdfx
tegra drm/tegra: Remove tegra_debugfs_cleanup() 2017-01-27 15:27:26 +01:00
tilcdc Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
ttm Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
udl Merge tag 'drm-misc-next-2017-01-09' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-01-10 08:06:56 +10:00
vc4 drm/vc4: Remove vc4_debugfs_cleanup() 2017-01-30 09:48:48 +01:00
vgem drm/vgem: Switch to reservation_object_lock() helpers 2017-01-24 11:00:23 +01:00
via drm: Change the return type of the unload hook to void 2017-01-09 11:25:22 +01:00
virtio drm/ttm: revert "implement LRU add callbacks v2" 2017-01-27 12:20:34 -05:00
vmwgfx Merge branch 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux into drm-next 2017-02-01 08:40:13 +10:00
zte ZTE DRM driver updates for 4.11: 2017-02-01 08:29:04 +10:00
ati_pcigart.c
drm_agpsupport.c drm/i810: drop device_is_agp callback 2017-01-26 10:44:43 +01:00
drm_atomic_helper.c Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
drm_atomic.c drm/atomic: Remove drm_atomic_debugfs_cleanup() 2017-01-27 09:02:03 +01:00
drm_auth.c drm/core: Use recommened kerneldoc for struct member refs 2017-01-25 16:22:42 +01:00
drm_blend.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_bridge.c drm/bridge: Use recommened kerneldoc for struct member refs 2017-01-02 09:17:26 +01:00
drm_bufs.c
drm_cache.c drm: Update drm_cache.c to pull in the new drm_cache.h 2017-01-24 11:00:22 +01:00
drm_color_mgmt.c drm/doc: use preferred struct reference in kernel-doc 2016-12-30 13:34:59 +01:00
drm_connector.c drm/doc: Clarify connector overview 2017-01-26 10:44:33 +01:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c drm/kms-helpers: Use recommened kerneldoc for struct member refs 2017-01-25 16:18:57 +01:00
drm_crtc_internal.h drm/atomic: Remove drm_atomic_debugfs_cleanup() 2017-01-27 09:02:03 +01:00
drm_crtc.c drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/ 2017-01-26 10:46:28 +01:00
drm_debugfs_crc.c drm: crc: Call wake_up_interruptible() each time there is a new CRC entry 2017-01-06 15:23:19 +01:00
drm_debugfs.c drm/atomic: Remove drm_atomic_debugfs_cleanup() 2017-01-27 09:02:03 +01:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/kms-helpers: Use recommened kerneldoc for struct member refs 2017-01-25 16:18:57 +01:00
drm_dp_mst_topology.c drm/dp: Store drm_device in MST topology manager 2017-01-25 06:01:48 +01:00
drm_drv.c Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
drm_dumb_buffers.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_edid_load.c
drm_edid.c drm/edid: Set YQ bits in the AVI infoframe according to CEA-861-F 2017-01-26 18:37:13 +02:00
drm_encoder_slave.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_encoder.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_fb_cma_helper.c drm/fb-cma-helper: Add drm_fbdev_cma_set_suspend_unlocked() 2017-01-24 11:00:22 +01:00
drm_fb_helper.c drm/kms-helpers: Use recommened kerneldoc for struct member refs 2017-01-25 16:18:57 +01:00
drm_flip_work.c
drm_fops.c drm/core: Use recommened kerneldoc for struct member refs 2017-01-25 16:22:42 +01:00
drm_fourcc.c
drm_framebuffer.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_gem_cma_helper.c drm: allow to use mmuless SoC 2017-01-06 11:04:54 +01:00
drm_gem.c drm/gem|prime|mm: Use recommened kerneldoc for struct member refs 2017-01-25 16:20:21 +01:00
drm_global.c drm: Update TTM initialization documentation 2016-12-30 12:52:10 +01:00
drm_hashtab.c
drm_info.c
drm_internal.h drm: remove device_is_agp callback 2017-01-26 10:45:14 +01:00
drm_ioc32.c
drm_ioctl.c drm: Export drm_ioctl_permit to kernel-doc 2016-12-30 12:40:48 +01:00
drm_irq.c drm: Nuke ums vgaarb support 2017-01-26 10:45:31 +01:00
drm_kms_helper_common.c
drm_legacy.h drm: compile drm_vm.c only when needed 2017-01-06 11:03:07 +01:00
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm_mm.c drm/gem|prime|mm: Use recommened kerneldoc for struct member refs 2017-01-25 16:20:21 +01:00
drm_mode_config.c drm: Show leaked connectors upon unload 2017-01-23 09:26:22 +01:00
drm_mode_object.c drm: Get atomic property value even if DRIVER_ATOMIC is not set 2016-12-27 10:44:33 +01:00
drm_modes.c Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
drm_modeset_helper.c drm: Convert all helpers to drm_connector_list_iter 2016-12-18 14:33:22 +01:00
drm_modeset_lock.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_of.c drm: Don't include <drm/drm_encoder.h> in <drm/drm_crtc.h> 2016-12-18 16:29:29 +05:30
drm_panel.c
drm_pci.c drm: remove device_is_agp callback 2017-01-26 10:45:14 +01:00
drm_plane_helper.c drm/kms-helpers: Use recommened kerneldoc for struct member refs 2017-01-25 16:18:57 +01:00
drm_plane.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_platform.c drm/core: Use recommened kerneldoc for struct member refs 2017-01-25 16:22:42 +01:00
drm_prime.c drm/prime: Clarify DMA-BUF/GEM Object lifetime 2017-01-27 15:00:26 +01:00
drm_print.c drm/printer: add debug printer 2016-12-30 11:43:40 +01:00
drm_probe_helper.c Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-02-01 08:31:09 +10:00
drm_property.c drm/kms-core: Use recommened kerneldoc for struct member refs 2017-01-25 16:30:34 +01:00
drm_rect.c drm/rect: Fix formatting of example code 2016-12-30 13:35:54 +01:00
drm_scatter.c
drm_simple_kms_helper.c drm/doc: use preferred struct reference in kernel-doc 2016-12-30 13:34:59 +01:00
drm_sysfs.c drm/core: Use recommened kerneldoc for struct member refs 2017-01-25 16:22:42 +01:00
drm_trace_points.c
drm_trace.h
drm_vm.c mm: use vmf->address instead of of vmf->virtual_address 2016-12-14 16:04:09 -08:00
drm_vma_manager.c
Kconfig drm: fix MMU dependencies 2017-01-12 10:54:52 +01:00
Makefile drm: compile drm_vm.c only when needed 2017-01-06 11:03:07 +01:00