Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: drm_stub: Fixing return value if driver master_set call failed

When dev->driver->master_set() failed ioctl call return 0
but the caller is not the DRM-Master because file_priv->is_master = 0.
Fix that by returning to ioctl caller the driver master_set error code.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Benjamin Gaignard and committed by
Dave Airlie
53ef1600 dc021644

+2 -2
+2 -2
drivers/gpu/drm/drm_stub.c
··· 203 203 int drm_setmaster_ioctl(struct drm_device *dev, void *data, 204 204 struct drm_file *file_priv) 205 205 { 206 - int ret; 206 + int ret = 0; 207 207 208 208 if (file_priv->is_master) 209 209 return 0; ··· 229 229 } 230 230 mutex_unlock(&dev->struct_mutex); 231 231 232 - return 0; 232 + return ret; 233 233 } 234 234 235 235 int drm_dropmaster_ioctl(struct drm_device *dev, void *data,