Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atmel-ssc: fix misuse of dev_dbg when requested ssc instance is not found

The ssc pointer is not valid when the id is not found in the list.
Convert the message from a debug one into an error message and avoid
dereferencing the bad pointer.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Huang Weiyi <weiyi.huang@gmail.com>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hans-Christian Egtvedt and committed by
Linus Torvalds
dfecb716 ab92661d

+1 -1
+1 -1
drivers/misc/atmel-ssc.c
··· 35 35 36 36 if (!ssc_valid) { 37 37 spin_unlock(&user_lock); 38 - dev_dbg(&ssc->pdev->dev, "could not find requested device\n"); 38 + pr_err("ssc: ssc%d platform device is missing\n", ssc_num); 39 39 return ERR_PTR(-ENODEV); 40 40 } 41 41