From: Sachin Kamat Date: Mon, 16 Sep 2013 03:31:10 +0000 (+0530) Subject: crypto: tegra-aes - Fix NULL pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6665ad20f020ffc8c632a4d4744a7550000f611e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git crypto: tegra-aes - Fix NULL pointer dereference 'dd' is tested for NULL. However, it is derefenced in the error message print. Change the print to pr_err to avoid this. Signed-off-by: Sachin Kamat Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index 403282f01af9..33f953091402 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c @@ -27,6 +27,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -716,7 +718,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, u8 *dt; if (!ctx || !dd) { - dev_err(dd->dev, "ctx=0x%x, dd=0x%x\n", + pr_err("ctx=0x%x, dd=0x%x\n", (unsigned int)ctx, (unsigned int)dd); return -EINVAL; }