Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce48f560 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: remove client from device list if failed to register"

parents 8c1e3440 c9a6f09f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015,2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -80,6 +80,11 @@ void *msm_dba_register_client(struct msm_dba_reg_info *info,
		if (rc) {
			pr_err("%s: Client register failed (%s, %d)\n",
			       __func__, info->chip_name, info->instance_id);
			/* remove the client from list before freeing */
			mutex_lock_nested(&device->dev_mutex,
						SINGLE_DEPTH_NESTING);
			list_del(&client->list);
			mutex_unlock(&device->dev_mutex);
			kfree(client);
			mutex_unlock(&register_mutex);
			return ERR_PTR(rc);