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

Commit 7364b4a2 authored by Girish Mahadevan's avatar Girish Mahadevan
Browse files

platform: msm: msm_bus: Exit module init if misc register fails



If the misc_register fails to register the char device then handle
this case gracefully and exit else there will be a bad dereference
during the later part of the module init.

Change-Id: I7587ae236fba5ed65d336772369d1bf91bbc425c
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent 84a40fce
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2015, 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
@@ -344,8 +344,10 @@ static int __init msm_buspm_dev_init(void)
	int ret = 0;

	ret = misc_register(&msm_buspm_misc);
	if (ret < 0)
		pr_err("%s: Cannot register misc device\n", __func__);
	if (ret < 0) {
		WARN_ON(1);
		return ret;
	}

	if (msm_buspm_misc.this_device->coherent_dma_mask == 0)
		msm_buspm_misc.this_device->coherent_dma_mask =