diff options
| author | Nathan Chancellor <[email protected]> | 2021-08-24 22:54:26 +0000 |
|---|---|---|
| committer | Jani Nikula <[email protected]> | 2021-09-14 16:48:30 +0000 |
| commit | 347c4db2afc7f9cf536144d167579ccf1e9bf028 (patch) | |
| tree | cdce1a1050fe98829d5c168666527524fad69f7f /lib/netdev-notifier-error-inject.c | |
| parent | drm/i915/selftests: Do not use import_obj uninitialized (diff) | |
| download | kernel-347c4db2afc7f9cf536144d167579ccf1e9bf028.tar.gz kernel-347c4db2afc7f9cf536144d167579ccf1e9bf028.zip | |
drm/i915/selftests: Always initialize err in igt_dmabuf_import_same_driver_lmem()
Clang warns:
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:127:13: warning:
variable 'err' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
} else if (PTR_ERR(import) != -EOPNOTSUPP) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:138:9: note:
uninitialized use occurs here
return err;
^~~
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:127:9: note: remove
the 'if' if its condition is always true
} else if (PTR_ERR(import) != -EOPNOTSUPP) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c:95:9: note:
initialize the variable 'err' to silence this warning
int err;
^
= 0
The test is expected to pass if i915_gem_prime_import() returns
-EOPNOTSUPP so initialize err to zero in this case.
Fixes: cdb35d1ed6d2 ("drm/i915/gem: Migrate to system at dma-buf attach time (v7)")
Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Thomas Hellström <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 46f20a353b80d02492655d99714f0566018a17e8)
Signed-off-by: Jani Nikula <[email protected]>
Diffstat (limited to 'lib/netdev-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions
