ASoC: tegra-alt: fix the error check
Sameer Pujar [Wed, 6 Jan 2016 06:05:27 +0000 (11:05 +0530)]
Fix the error check in function tegra210_adsp_app_init(), as return value
is from ERR_PTR this needs to be checked with IS_ERR macro.

Bug 200154983

Change-Id: I951cccf6a65bdfd829da1bd79e2622a40ecf30cd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/929336
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>

sound/soc/tegra-alt/tegra210_adsp_alt.c

index e0f0630..46b4c6d 100644 (file)
@@ -2,7 +2,7 @@
  * tegra210_adsp_alt.c - Tegra ADSP audio driver
  *
  * Author: Sumit Bhattacharya <sumitb@nvidia.com>
- * Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  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
@@ -568,9 +568,11 @@ static int tegra210_adsp_app_init(struct tegra210_adsp *adsp,
        }
 
        app->info = nvadsp_app_init(app->desc->handle, NULL);
-       if (!app->info) {
-               dev_err(adsp->dev, "Failed to init app %s(%s).",
-                       app->desc->name, app->desc->fw_name);
+       if (IS_ERR_OR_NULL(app->info)) {
+               dev_err(adsp->dev, "Failed to init app %s(%s),"
+                       "nvadsp_app_init() returned with error %ld",
+                       app->desc->name, app->desc->fw_name, PTR_ERR(app->info));
+               app->info = NULL;
                return -ENODEV;
        }