void v3d_perfmon_put(struct v3d_perfmon *perfmon)
 {
-       if (perfmon && refcount_dec_and_test(&perfmon->refcnt))
+       if (perfmon && refcount_dec_and_test(&perfmon->refcnt)) {
+               mutex_destroy(&perfmon->lock);
                kfree(perfmon);
+       }
 }
 
 void v3d_perfmon_start(struct v3d_dev *v3d, struct v3d_perfmon *perfmon)
        idr_for_each(&v3d_priv->perfmon.idr, v3d_perfmon_idr_del, NULL);
        idr_destroy(&v3d_priv->perfmon.idr);
        mutex_unlock(&v3d_priv->perfmon.lock);
+       mutex_destroy(&v3d_priv->perfmon.lock);
 }
 
 int v3d_perfmon_create_ioctl(struct drm_device *dev, void *data,
        mutex_unlock(&v3d_priv->perfmon.lock);
 
        if (ret < 0) {
+               mutex_destroy(&perfmon->lock);
                kfree(perfmon);
                return ret;
        }