Skip to content

Commit dfecb71

Browse files
Hans-Christian Egtvedttorvalds
authored andcommitted
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>
1 parent ab92661 commit dfecb71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/misc/atmel-ssc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
3535

3636
if (!ssc_valid) {
3737
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);
3939
return ERR_PTR(-ENODEV);
4040
}
4141

0 commit comments

Comments
 (0)