]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ASoC: tegra-alt: fix the error check
authorSameer Pujar <spujar@nvidia.com>
Wed, 6 Jan 2016 06:05:27 +0000 (11:35 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 7 Jan 2016 16:32:55 +0000 (08:32 -0800)
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 e0f06305b7add6bcce1f24bfd329fab4dc5ba998..46b4c6d153aec9cc8bb89036d636dfc142b1093c 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;
        }