* [drm-drm-misc:drm-misc-next 3/5] drivers/gpu/drm/drm_aperture.c:185 devm_aperture_acquire() warn: inconsistent returns '&drm_apertures_lock'.
@ 2021-05-03 10:09 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-05-01 16:08 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3446 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Thomas Zimmermann <tzimmermann@suse.de>
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: 4aae79f77e3a9c53b225a5b2c35951f568156eee
commit: 730e7992dc1beedf2c33001cc0d791c3cdf6c842 [3/5] drm/aperture: Add infrastructure for aperture ownership
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: x86_64-randconfig-m001-20210430 (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/drm_aperture.c:185 devm_aperture_acquire() warn: inconsistent returns '&drm_apertures_lock'.
vim +185 drivers/gpu/drm/drm_aperture.c
730e7992dc1bee Thomas Zimmermann 2021-04-30 154
730e7992dc1bee Thomas Zimmermann 2021-04-30 155 static int devm_aperture_acquire(struct drm_device *dev,
730e7992dc1bee Thomas Zimmermann 2021-04-30 156 resource_size_t base, resource_size_t size,
730e7992dc1bee Thomas Zimmermann 2021-04-30 157 void (*detach)(struct drm_device *))
730e7992dc1bee Thomas Zimmermann 2021-04-30 158 {
730e7992dc1bee Thomas Zimmermann 2021-04-30 159 size_t end = base + size;
730e7992dc1bee Thomas Zimmermann 2021-04-30 160 struct list_head *pos;
730e7992dc1bee Thomas Zimmermann 2021-04-30 161 struct drm_aperture *ap;
730e7992dc1bee Thomas Zimmermann 2021-04-30 162
730e7992dc1bee Thomas Zimmermann 2021-04-30 163 mutex_lock(&drm_apertures_lock);
730e7992dc1bee Thomas Zimmermann 2021-04-30 164
730e7992dc1bee Thomas Zimmermann 2021-04-30 165 list_for_each(pos, &drm_apertures) {
730e7992dc1bee Thomas Zimmermann 2021-04-30 166 ap = container_of(pos, struct drm_aperture, lh);
730e7992dc1bee Thomas Zimmermann 2021-04-30 167 if (overlap(base, end, ap->base, ap->base + ap->size))
730e7992dc1bee Thomas Zimmermann 2021-04-30 168 return -EBUSY;
730e7992dc1bee Thomas Zimmermann 2021-04-30 169 }
730e7992dc1bee Thomas Zimmermann 2021-04-30 170
730e7992dc1bee Thomas Zimmermann 2021-04-30 171 ap = devm_kzalloc(dev->dev, sizeof(*ap), GFP_KERNEL);
730e7992dc1bee Thomas Zimmermann 2021-04-30 172 if (!ap)
730e7992dc1bee Thomas Zimmermann 2021-04-30 173 return -ENOMEM;
730e7992dc1bee Thomas Zimmermann 2021-04-30 174
730e7992dc1bee Thomas Zimmermann 2021-04-30 175 ap->dev = dev;
730e7992dc1bee Thomas Zimmermann 2021-04-30 176 ap->base = base;
730e7992dc1bee Thomas Zimmermann 2021-04-30 177 ap->size = size;
730e7992dc1bee Thomas Zimmermann 2021-04-30 178 ap->detach = detach;
730e7992dc1bee Thomas Zimmermann 2021-04-30 179 INIT_LIST_HEAD(&ap->lh);
730e7992dc1bee Thomas Zimmermann 2021-04-30 180
730e7992dc1bee Thomas Zimmermann 2021-04-30 181 list_add(&ap->lh, &drm_apertures);
730e7992dc1bee Thomas Zimmermann 2021-04-30 182
730e7992dc1bee Thomas Zimmermann 2021-04-30 183 mutex_unlock(&drm_apertures_lock);
730e7992dc1bee Thomas Zimmermann 2021-04-30 184
730e7992dc1bee Thomas Zimmermann 2021-04-30 @185 return devm_add_action_or_reset(dev->dev, devm_aperture_acquire_release, ap);
730e7992dc1bee Thomas Zimmermann 2021-04-30 186 }
730e7992dc1bee Thomas Zimmermann 2021-04-30 187
---
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: 34977 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [drm-drm-misc:drm-misc-next 3/5] drivers/gpu/drm/drm_aperture.c:185 devm_aperture_acquire() warn: inconsistent returns '&drm_apertures_lock'.
@ 2021-05-03 10:09 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-05-03 10:09 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3267 bytes --]
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: 4aae79f77e3a9c53b225a5b2c35951f568156eee
commit: 730e7992dc1beedf2c33001cc0d791c3cdf6c842 [3/5] drm/aperture: Add infrastructure for aperture ownership
config: x86_64-randconfig-m001-20210430 (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/drm_aperture.c:185 devm_aperture_acquire() warn: inconsistent returns '&drm_apertures_lock'.
vim +185 drivers/gpu/drm/drm_aperture.c
730e7992dc1bee Thomas Zimmermann 2021-04-30 155 static int devm_aperture_acquire(struct drm_device *dev,
730e7992dc1bee Thomas Zimmermann 2021-04-30 156 resource_size_t base, resource_size_t size,
730e7992dc1bee Thomas Zimmermann 2021-04-30 157 void (*detach)(struct drm_device *))
730e7992dc1bee Thomas Zimmermann 2021-04-30 158 {
730e7992dc1bee Thomas Zimmermann 2021-04-30 159 size_t end = base + size;
730e7992dc1bee Thomas Zimmermann 2021-04-30 160 struct list_head *pos;
730e7992dc1bee Thomas Zimmermann 2021-04-30 161 struct drm_aperture *ap;
730e7992dc1bee Thomas Zimmermann 2021-04-30 162
730e7992dc1bee Thomas Zimmermann 2021-04-30 163 mutex_lock(&drm_apertures_lock);
730e7992dc1bee Thomas Zimmermann 2021-04-30 164
730e7992dc1bee Thomas Zimmermann 2021-04-30 165 list_for_each(pos, &drm_apertures) {
730e7992dc1bee Thomas Zimmermann 2021-04-30 166 ap = container_of(pos, struct drm_aperture, lh);
730e7992dc1bee Thomas Zimmermann 2021-04-30 167 if (overlap(base, end, ap->base, ap->base + ap->size))
730e7992dc1bee Thomas Zimmermann 2021-04-30 168 return -EBUSY;
mutex_unlock(&drm_apertures_lock); before returning
730e7992dc1bee Thomas Zimmermann 2021-04-30 169 }
730e7992dc1bee Thomas Zimmermann 2021-04-30 170
730e7992dc1bee Thomas Zimmermann 2021-04-30 171 ap = devm_kzalloc(dev->dev, sizeof(*ap), GFP_KERNEL);
730e7992dc1bee Thomas Zimmermann 2021-04-30 172 if (!ap)
730e7992dc1bee Thomas Zimmermann 2021-04-30 173 return -ENOMEM;
Same
730e7992dc1bee Thomas Zimmermann 2021-04-30 174
730e7992dc1bee Thomas Zimmermann 2021-04-30 175 ap->dev = dev;
730e7992dc1bee Thomas Zimmermann 2021-04-30 176 ap->base = base;
730e7992dc1bee Thomas Zimmermann 2021-04-30 177 ap->size = size;
730e7992dc1bee Thomas Zimmermann 2021-04-30 178 ap->detach = detach;
730e7992dc1bee Thomas Zimmermann 2021-04-30 179 INIT_LIST_HEAD(&ap->lh);
730e7992dc1bee Thomas Zimmermann 2021-04-30 180
730e7992dc1bee Thomas Zimmermann 2021-04-30 181 list_add(&ap->lh, &drm_apertures);
730e7992dc1bee Thomas Zimmermann 2021-04-30 182
730e7992dc1bee Thomas Zimmermann 2021-04-30 183 mutex_unlock(&drm_apertures_lock);
730e7992dc1bee Thomas Zimmermann 2021-04-30 184
730e7992dc1bee Thomas Zimmermann 2021-04-30 @185 return devm_add_action_or_reset(dev->dev, devm_aperture_acquire_release, ap);
730e7992dc1bee Thomas Zimmermann 2021-04-30 186 }
---
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] 2+ messages in thread
end of thread, other threads:[~2021-05-03 10:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 16:08 [drm-drm-misc:drm-misc-next 3/5] drivers/gpu/drm/drm_aperture.c:185 devm_aperture_acquire() warn: inconsistent returns '&drm_apertures_lock' kernel test robot
2021-05-03 10:09 ` Dan Carpenter
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.