OSDN Git Service

msm: sps: Suppress bind/unbind attributes
authorSiva Kumar Akkireddi <sivaa@codeaurora.org>
Thu, 5 Jul 2018 05:25:32 +0000 (10:55 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Thu, 26 Jul 2018 15:43:13 +0000 (08:43 -0700)
SPS driver does not support manual bind/unbind operations
through sysfs. Suppress the bind/unbind nodes. Do not free
SPS struct in sps_device_de_init since it is being done in
sps_exit, and also to avoid use-after-free.

Change-Id: If6da6c5fb9d1a44d0420c6151f7f9d0a33cb2d04
Signed-off-by: Siva Kumar Akkireddi <sivaa@codeaurora.org>
drivers/platform/msm/sps/sps.c

index 59a9b91..0f6b667 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2018, 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
@@ -1006,8 +1006,6 @@ static void sps_device_de_init(void)
                                "sps:%s:BAMs are still registered", __func__);
 
                sps_map_de_init();
-
-               kfree(sps);
        }
 
        sps_mem_de_init();
@@ -2993,6 +2991,7 @@ static struct platform_driver msm_sps_driver = {
                .name   = SPS_DRV_NAME,
                .owner  = THIS_MODULE,
                .of_match_table = msm_sps_match,
+               .suppress_bind_attrs = true,
        },
        .remove         = msm_sps_remove,
 };