lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151013150002.GA27569@Red>
Date:	Tue, 13 Oct 2015 17:00:02 +0200
From:	LABBE Corentin <clabbe.montjoie@...il.com>
To:	pankaj.dubey@...sung.com
Cc:	linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, kgene.kim@...sung.com,
	k.kozlowski@...sung.com, p.fedin@...sung.com, thomas.ab@...sung.com
Subject: Re: [PATCH v3 6/8] drivers: soc: add support for exynos SROM driver

+static struct exynos_srom_reg_dump *exynos_srom_alloc_reg_dump(
+               const unsigned long *rdump,
+               unsigned long nr_rdump)
+{
+       struct exynos_srom_reg_dump *rd;
+       unsigned int i;
+ 
+       rd = kcalloc(nr_rdump, sizeof(*rd), GFP_KERNEL);
+       if (!rd)
+               return NULL;
+
+       for (i = 0; i < nr_rdump; ++i)
+               rd[i].offset = rdump[i];
+
+       return rd;
+}

You do not free rd anywhere in your code.

+static int exynos_srom_probe(struct platform_device *pdev)
+{
+       struct device_node *np;
+       struct device *dev = &pdev->dev;
+
+       np = dev->of_node;

Are you sure that dev->of_node will be always set ?
I see lots of driver who if (dev->of_node) {}

+       exynos_srom_base = of_iomap(np, 0);
+
+       if (!exynos_srom_base) {
+               pr_err("iomap of exynos srom controller failed\n");
+               return -ENOMEM;
+       }

You can use dev_err(dev, "") insted of pr_err

+
+       exynos_srom_regs = exynos_srom_alloc_reg_dump(exynos_srom_offsets,
+                       sizeof(exynos_srom_offsets));
+
+       if (!exynos_srom_regs) {
+               iounmap(exynos_srom_regs);
+               return -ENOMEM;
+       }
+
+       return 0;
+}

Instead of using a global static exynos_srom_base/exynos_srom_regs, why you do not use platform_set_drvdata() ?

Regards
LABBE Corentin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ