coresight: fix the dangling pointer issues on coresight
Fix the dangling pointer issues on CoreSight that can cause kernel panic. Change-Id: If3abe89bf0326230c29a49d293ab22ebcec93076 Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
parent
ff2f604611
commit
2c23067f45
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2013,2016 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
|
||||
|
@ -195,8 +195,6 @@ static int csr_probe(struct platform_device *pdev)
|
|||
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
|
||||
if (!drvdata)
|
||||
return -ENOMEM;
|
||||
/* Store the driver data pointer for use in exported functions */
|
||||
csrdrvdata = drvdata;
|
||||
drvdata->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, drvdata);
|
||||
|
||||
|
@ -227,6 +225,9 @@ static int csr_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(drvdata->csdev))
|
||||
return PTR_ERR(drvdata->csdev);
|
||||
|
||||
/* Store the driver data pointer for use in exported functions */
|
||||
csrdrvdata = drvdata;
|
||||
|
||||
dev_info(dev, "CSR initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2016, 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
|
||||
|
@ -305,8 +305,6 @@ static int fuse_probe(struct platform_device *pdev)
|
|||
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
|
||||
if (!drvdata)
|
||||
return -ENOMEM;
|
||||
/* Store the driver data pointer for use in exported functions */
|
||||
fusedrvdata = drvdata;
|
||||
drvdata->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, drvdata);
|
||||
|
||||
|
@ -370,6 +368,9 @@ static int fuse_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(drvdata->csdev))
|
||||
return PTR_ERR(drvdata->csdev);
|
||||
|
||||
/* Store the driver data pointer for use in exported functions */
|
||||
fusedrvdata = drvdata;
|
||||
|
||||
dev_info(dev, "Fuse initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2016, 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
|
||||
|
@ -152,8 +152,6 @@ static int jtag_fuse_probe(struct platform_device *pdev)
|
|||
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
|
||||
if (!drvdata)
|
||||
return -ENOMEM;
|
||||
/* Store the driver data pointer for use in exported functions */
|
||||
fusedrvdata = drvdata;
|
||||
drvdata->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, drvdata);
|
||||
|
||||
|
@ -174,6 +172,8 @@ static int jtag_fuse_probe(struct platform_device *pdev)
|
|||
if (!drvdata->base)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Store the driver data pointer for use in exported functions */
|
||||
fusedrvdata = drvdata;
|
||||
dev_info(dev, "JTag Fuse initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue