diff mbox series

net: atm: Add another IS_ENABLED(CONFIG_COMPAT) in atm_dev_ioctl

Message ID 20190307181125.7705-1-natechancellor@gmail.com
State Accepted
Delegated to: David Miller
Headers show
Series net: atm: Add another IS_ENABLED(CONFIG_COMPAT) in atm_dev_ioctl | expand

Commit Message

Nathan Chancellor March 7, 2019, 6:11 p.m. UTC
I removed compat's universal assignment to 0, which allows this if
statement to fall through when compat is passed with a value other
than 0.

Fixes: f9d19a7494e5 ("net: atm: Use IS_ENABLED in atm_dev_ioctl")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

Sorry for not paying more attention :(

 net/atm/resources.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 7, 2019, 6:59 p.m. UTC | #1
From: Nathan Chancellor <natechancellor@gmail.com>
Date: Thu,  7 Mar 2019 11:11:26 -0700

> I removed compat's universal assignment to 0, which allows this if
> statement to fall through when compat is passed with a value other
> than 0.
> 
> Fixes: f9d19a7494e5 ("net: atm: Use IS_ENABLED in atm_dev_ioctl")
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Applied.
diff mbox series

Patch

diff --git a/net/atm/resources.c b/net/atm/resources.c
index 3e9f6391319e..889349c6d90d 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -413,7 +413,7 @@  int atm_dev_ioctl(unsigned int cmd, void __user *arg, int compat)
 		}
 		/* fall through */
 	default:
-		if (compat) {
+		if (IS_ENABLED(CONFIG_COMPAT) && compat) {
 #ifdef CONFIG_COMPAT
 			if (!dev->ops->compat_ioctl) {
 				error = -EINVAL;