* [patch] ALSA: line6: fix a crash in line6_hwdep_write()
@ 2016-10-12 6:21 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-10-12 6:21 UTC (permalink / raw)
To: Jaroslav Kysela, Andrej Krutak
Cc: Takashi Iwai, Takashi Sakamoto, kbuild test robot, alsa-devel,
kernel-janitors
The error checking here is messed up so we could end up dereferencing
-EFAULT.
Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index 14e587e..90009c0 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
}
data_copy = memdup_user(data, count);
- if (IS_ERR(ERR_PTR))
- return -ENOMEM;
+ if (IS_ERR(data_copy))
+ return PTR_ERR(data_copy);
rv = line6_send_raw_message(line6, data_copy, count);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch] ALSA: line6: fix a crash in line6_hwdep_write()
@ 2016-10-12 6:21 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-10-12 6:21 UTC (permalink / raw)
To: Jaroslav Kysela, Andrej Krutak
Cc: Takashi Iwai, Takashi Sakamoto, kbuild test robot, alsa-devel,
kernel-janitors
The error checking here is messed up so we could end up dereferencing
-EFAULT.
Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index 14e587e..90009c0 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
}
data_copy = memdup_user(data, count);
- if (IS_ERR(ERR_PTR))
- return -ENOMEM;
+ if (IS_ERR(data_copy))
+ return PTR_ERR(data_copy);
rv = line6_send_raw_message(line6, data_copy, count);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [patch] ALSA: line6: fix a crash in line6_hwdep_write()
2016-10-12 6:21 ` Dan Carpenter
@ 2016-10-12 6:41 ` Takashi Sakamoto
-1 siblings, 0 replies; 6+ messages in thread
From: Takashi Sakamoto @ 2016-10-12 6:41 UTC (permalink / raw)
To: Dan Carpenter, Jaroslav Kysela, Andrej Krutak
Cc: alsa-devel, kbuild test robot, kernel-janitors, Takashi Iwai
On Oct 12 2016 15:21, Dan Carpenter wrote:
> The error checking here is messed up so we could end up dereferencing
> -EFAULT.
>
> Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
> index 14e587e..90009c0 100644
> --- a/sound/usb/line6/driver.c
> +++ b/sound/usb/line6/driver.c
> @@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
> }
>
> data_copy = memdup_user(data, count);
> - if (IS_ERR(ERR_PTR))
> - return -ENOMEM;
> + if (IS_ERR(data_copy))
> + return PTR_ERR(data_copy);
>
> rv = line6_send_raw_message(line6, data_copy, count);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] ALSA: line6: fix a crash in line6_hwdep_write()
@ 2016-10-12 6:41 ` Takashi Sakamoto
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Sakamoto @ 2016-10-12 6:41 UTC (permalink / raw)
To: Dan Carpenter, Jaroslav Kysela, Andrej Krutak
Cc: alsa-devel, kbuild test robot, kernel-janitors, Takashi Iwai
On Oct 12 2016 15:21, Dan Carpenter wrote:
> The error checking here is messed up so we could end up dereferencing
> -EFAULT.
>
> Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
> index 14e587e..90009c0 100644
> --- a/sound/usb/line6/driver.c
> +++ b/sound/usb/line6/driver.c
> @@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
> }
>
> data_copy = memdup_user(data, count);
> - if (IS_ERR(ERR_PTR))
> - return -ENOMEM;
> + if (IS_ERR(data_copy))
> + return PTR_ERR(data_copy);
>
> rv = line6_send_raw_message(line6, data_copy, count);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] ALSA: line6: fix a crash in line6_hwdep_write()
2016-10-12 6:21 ` Dan Carpenter
@ 2016-10-12 18:11 ` Takashi Iwai
-1 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2016-10-12 18:11 UTC (permalink / raw)
To: Dan Carpenter
Cc: Andrej Krutak, Jaroslav Kysela, alsa-devel, kbuild test robot,
Takashi Sakamoto, kernel-janitors
On Wed, 12 Oct 2016 08:21:40 +0200,
Dan Carpenter wrote:
>
> The error checking here is messed up so we could end up dereferencing
> -EFAULT.
>
> Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks.
Takashi
>
> diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
> index 14e587e..90009c0 100644
> --- a/sound/usb/line6/driver.c
> +++ b/sound/usb/line6/driver.c
> @@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
> }
>
> data_copy = memdup_user(data, count);
> - if (IS_ERR(ERR_PTR))
> - return -ENOMEM;
> + if (IS_ERR(data_copy))
> + return PTR_ERR(data_copy);
>
> rv = line6_send_raw_message(line6, data_copy, count);
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] ALSA: line6: fix a crash in line6_hwdep_write()
@ 2016-10-12 18:11 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2016-10-12 18:11 UTC (permalink / raw)
To: Dan Carpenter
Cc: Andrej Krutak, Jaroslav Kysela, alsa-devel, kbuild test robot,
Takashi Sakamoto, kernel-janitors
On Wed, 12 Oct 2016 08:21:40 +0200,
Dan Carpenter wrote:
>
> The error checking here is messed up so we could end up dereferencing
> -EFAULT.
>
> Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks.
Takashi
>
> diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
> index 14e587e..90009c0 100644
> --- a/sound/usb/line6/driver.c
> +++ b/sound/usb/line6/driver.c
> @@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
> }
>
> data_copy = memdup_user(data, count);
> - if (IS_ERR(ERR_PTR))
> - return -ENOMEM;
> + if (IS_ERR(data_copy))
> + return PTR_ERR(data_copy);
>
> rv = line6_send_raw_message(line6, data_copy, count);
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-10-12 18:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-12 6:21 [patch] ALSA: line6: fix a crash in line6_hwdep_write() Dan Carpenter
2016-10-12 6:21 ` Dan Carpenter
2016-10-12 6:41 ` Takashi Sakamoto
2016-10-12 6:41 ` Takashi Sakamoto
2016-10-12 18:11 ` Takashi Iwai
2016-10-12 18:11 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.