Bug 101243 - Possible access to unintended variable in "linux/drivers/gpu/drm/i915/dvo_ch7xxx.c" line 234
Summary: Possible access to unintended variable in "linux/drivers/gpu/drm/i915/dvo_ch7...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: Other All
: medium minor
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard: PatchSubmitted
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-31 09:16 UTC by Petru Mihancea
Modified: 2017-06-01 12:55 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Petru Mihancea 2017-05-31 09:16:18 UTC
While experimenting with a CodeSonar plugin we develop, we noticed a
potential issue in file "linux/drivers/gpu/drm/i915/dvo_ch7xxx.c" line 234 function ch7xxx_init

if (!ch7xxx_readb(dvo, CH7xxx_REG_DID, &device))
		goto out;

	devid = ch7xxx_get_did(device);
	if (!devid) {
		DRM_DEBUG_KMS("ch7xxx not detected; got 0x%02x from %s "
				"slave %d.\n",
	/*here*/	  vendor, adapter->name, dvo->slave_addr);
		goto out;
}

Wasn't the intention to log the value of the "device" variable (instead of "vendor")? The message indicates that the intention is to log the value got from ch7xxx (in this case device). The vendor is logged in line 222.

Thank you.
Comment 2 Jani Nikula 2017-06-01 12:55:14 UTC
Fixed by

commit 3d06bf421a9b376bb658b1531de8826f1bf811ff
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed May 31 13:16:31 2017 +0300

    drm/i915/dvo: fix debug logging on unknown DID

Thanks for the report.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.