All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [agd5f:drm-next 435/435] drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:923 amdgpu_acpi_init() warn: possible memory leak of 'atcs'
Date: Thu, 20 May 2021 16:49:08 +0800	[thread overview]
Message-ID: <202105201605.mbPvfS3d-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
TO: Alex Deucher <alexander.deucher@amd.com>

tree:   https://gitlab.freedesktop.org/agd5f/linux.git drm-next
head:   a8b065e7d63ddb20752da325bfc765a419d80a3e
commit: a8b065e7d63ddb20752da325bfc765a419d80a3e [435/435] drm/amdgpu/acpi: unify ATCS handling (v2)
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: x86_64-randconfig-m001-20210520 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:923 amdgpu_acpi_init() warn: possible memory leak of 'atcs'

vim +/atcs +923 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

d38ceaf99ed015 Alex Deucher  2015-04-20  867  
d38ceaf99ed015 Alex Deucher  2015-04-20  868  	if (atif->functions.sbios_requests && !atif->functions.system_params) {
d38ceaf99ed015 Alex Deucher  2015-04-20  869  		/* XXX check this workraround, if sbios request function is
d38ceaf99ed015 Alex Deucher  2015-04-20  870  		 * present we have to see how it's configured in the system
d38ceaf99ed015 Alex Deucher  2015-04-20  871  		 * params
d38ceaf99ed015 Alex Deucher  2015-04-20  872  		 */
d38ceaf99ed015 Alex Deucher  2015-04-20  873  		atif->functions.system_params = true;
d38ceaf99ed015 Alex Deucher  2015-04-20  874  	}
d38ceaf99ed015 Alex Deucher  2015-04-20  875  
d38ceaf99ed015 Alex Deucher  2015-04-20  876  	if (atif->functions.system_params) {
280cf1a94b822d Lyude Paul    2018-06-25  877  		ret = amdgpu_atif_get_notification_params(atif);
d38ceaf99ed015 Alex Deucher  2015-04-20  878  		if (ret) {
d38ceaf99ed015 Alex Deucher  2015-04-20  879  			DRM_DEBUG_DRIVER("Call to GET_SYSTEM_PARAMS failed: %d\n",
d38ceaf99ed015 Alex Deucher  2015-04-20  880  					ret);
d38ceaf99ed015 Alex Deucher  2015-04-20  881  			/* Disable notification */
d38ceaf99ed015 Alex Deucher  2015-04-20  882  			atif->notification_cfg.enabled = false;
d38ceaf99ed015 Alex Deucher  2015-04-20  883  		}
d38ceaf99ed015 Alex Deucher  2015-04-20  884  	}
d38ceaf99ed015 Alex Deucher  2015-04-20  885  
206bbafe00dcac David Francis 2018-11-26  886  	if (atif->functions.query_backlight_transfer_characteristics) {
206bbafe00dcac David Francis 2018-11-26  887  		ret = amdgpu_atif_query_backlight_caps(atif);
206bbafe00dcac David Francis 2018-11-26  888  		if (ret) {
206bbafe00dcac David Francis 2018-11-26  889  			DRM_DEBUG_DRIVER("Call to QUERY_BACKLIGHT_TRANSFER_CHARACTERISTICS failed: %d\n",
206bbafe00dcac David Francis 2018-11-26  890  					ret);
206bbafe00dcac David Francis 2018-11-26  891  			atif->backlight_caps.caps_valid = false;
206bbafe00dcac David Francis 2018-11-26  892  		}
206bbafe00dcac David Francis 2018-11-26  893  	} else {
206bbafe00dcac David Francis 2018-11-26  894  		atif->backlight_caps.caps_valid = false;
206bbafe00dcac David Francis 2018-11-26  895  	}
206bbafe00dcac David Francis 2018-11-26  896  
a8b065e7d63ddb Alex Deucher  2021-05-19  897  atcs:
a8b065e7d63ddb Alex Deucher  2021-05-19  898  	/* Probe for ATCS, and initialize it if found */
a8b065e7d63ddb Alex Deucher  2021-05-19  899  	atcs_handle = amdgpu_atcs_probe_handle(handle);
a8b065e7d63ddb Alex Deucher  2021-05-19  900  	if (!atcs_handle)
a8b065e7d63ddb Alex Deucher  2021-05-19  901  		goto out;
a8b065e7d63ddb Alex Deucher  2021-05-19  902  
a8b065e7d63ddb Alex Deucher  2021-05-19  903  	atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
a8b065e7d63ddb Alex Deucher  2021-05-19  904  	if (!atif) {
a8b065e7d63ddb Alex Deucher  2021-05-19  905  		DRM_WARN("Not enough memory to initialize ATCS\n");
a8b065e7d63ddb Alex Deucher  2021-05-19  906  		goto out;
a8b065e7d63ddb Alex Deucher  2021-05-19  907  	}
a8b065e7d63ddb Alex Deucher  2021-05-19  908  	atcs->handle = atcs_handle;
a8b065e7d63ddb Alex Deucher  2021-05-19  909  
a8b065e7d63ddb Alex Deucher  2021-05-19  910  	/* Call the ATCS method */
a8b065e7d63ddb Alex Deucher  2021-05-19  911  	ret = amdgpu_atcs_verify_interface(atcs);
a8b065e7d63ddb Alex Deucher  2021-05-19  912  	if (ret) {
a8b065e7d63ddb Alex Deucher  2021-05-19  913  		DRM_DEBUG_DRIVER("Call to ATCS verify_interface failed: %d\n", ret);
a8b065e7d63ddb Alex Deucher  2021-05-19  914  		kfree(atcs);
a8b065e7d63ddb Alex Deucher  2021-05-19  915  		goto out;
a8b065e7d63ddb Alex Deucher  2021-05-19  916  	}
a8b065e7d63ddb Alex Deucher  2021-05-19  917  	adev->atcs = atcs;
a8b065e7d63ddb Alex Deucher  2021-05-19  918  
d38ceaf99ed015 Alex Deucher  2015-04-20  919  out:
d38ceaf99ed015 Alex Deucher  2015-04-20  920  	adev->acpi_nb.notifier_call = amdgpu_acpi_event;
d38ceaf99ed015 Alex Deucher  2015-04-20  921  	register_acpi_notifier(&adev->acpi_nb);
d38ceaf99ed015 Alex Deucher  2015-04-20  922  
d38ceaf99ed015 Alex Deucher  2015-04-20 @923  	return ret;
d38ceaf99ed015 Alex Deucher  2015-04-20  924  }
d38ceaf99ed015 Alex Deucher  2015-04-20  925  

:::::: The code at line 923 was first introduced by commit
:::::: d38ceaf99ed015f2a0b9af3499791bd3a3daae21 drm/amdgpu: add core driver (v4)

:::::: TO: Alex Deucher <alexander.deucher@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27605 bytes --]

                 reply	other threads:[~2021-05-20  8:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202105201605.mbPvfS3d-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.