Skip to content

Commit fb721b2

Browse files
committed
drm: writeback: Fix drm_writeback_connector_cleanup signature
The drm_writeback_connector_cleanup have the signature: static void drm_writeback_connector_cleanup( struct drm_device *dev, struct drm_writeback_connector *wb_connector) But it is stored and used as a drmres_release_t typedef void (*drmres_release_t)(struct drm_device *dev, void *res); While the current code is valid and does not produce any warning, the CFI runtime check (CONFIG_CFI_CLANG) can fail because the function signature is not the same as drmres_release_t. In order to fix this, change the function signature to match what is expected by drmres_release_t. Fixes: 1914ba2 ("drm: writeback: Create drmm variants for drm_writeback_connector initialization") Suggested-by: Mark Yacoub <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Louis Chauvet <[email protected]>
1 parent 61ee19d commit fb721b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/drm_writeback.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,18 @@ EXPORT_SYMBOL(drm_writeback_connector_init_with_encoder);
343343
/**
344344
* drm_writeback_connector_cleanup - Cleanup the writeback connector
345345
* @dev: DRM device
346-
* @wb_connector: Pointer to the writeback connector to clean up
346+
* @data: Pointer to the writeback connector to clean up
347347
*
348348
* This will decrement the reference counter of blobs and destroy properties. It
349349
* will also clean the remaining jobs in this writeback connector. Caution: This helper will not
350350
* clean up the attached encoder and the drm_connector.
351351
*/
352352
static void drm_writeback_connector_cleanup(struct drm_device *dev,
353-
struct drm_writeback_connector *wb_connector)
353+
void *data)
354354
{
355355
unsigned long flags;
356356
struct drm_writeback_job *pos, *n;
357+
struct drm_writeback_connector *wb_connector = data;
357358

358359
delete_writeback_properties(dev);
359360
drm_property_blob_put(wb_connector->pixel_formats_blob_ptr);
@@ -405,7 +406,7 @@ int drmm_writeback_connector_init(struct drm_device *dev,
405406
if (ret)
406407
return ret;
407408

408-
ret = drmm_add_action_or_reset(dev, (void *)drm_writeback_connector_cleanup,
409+
ret = drmm_add_action_or_reset(dev, drm_writeback_connector_cleanup,
409410
wb_connector);
410411
if (ret)
411412
return ret;

0 commit comments

Comments
 (0)