All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 5/5] sound: sound_firmware: Fix invalid use of vfs_read()
Date: Tue, 26 May 2015 14:41:52 +0200	[thread overview]
Message-ID: <1432644112-16543-6-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1432644112-16543-1-git-send-email-tiwai@suse.de>

It should use kernel_read() instead of vfs_read() to load a firmware
binary onto the kernel pages.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/sound_firmware.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c
index b155137ee312..026347643c81 100644
--- a/sound/sound_firmware.c
+++ b/sound/sound_firmware.c
@@ -12,7 +12,6 @@ static int do_mod_firmware_load(const char *fn, char **fp)
 	struct file* filp;
 	long l;
 	char *dp;
-	loff_t pos;
 
 	filp = filp_open(fn, 0, 0);
 	if (IS_ERR(filp))
@@ -34,8 +33,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
 		fput(filp);
 		return 0;
 	}
-	pos = 0;
-	if (vfs_read(filp, dp, l, &pos) != l)
+	if (kernel_read(filp, 0, dp, l) != l)
 	{
 		printk(KERN_INFO "Failed to read '%s'.\n", fn);
 		vfree(dp);
-- 
2.4.1

      parent reply	other threads:[~2015-05-26 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 12:41 [PATCH 0/5] Trivial cleanups Takashi Iwai
2015-05-26 12:41 ` [PATCH 1/5] ALSA: dummy: make local data static Takashi Iwai
2015-05-26 12:41 ` [PATCH 2/5] ALSA: lx6464es: Fix duplicated SSID entries Takashi Iwai
2015-05-26 12:41 ` [PATCH 3/5] ALSA: lx6464es: Use NULL for pointers Takashi Iwai
2015-05-26 12:41 ` [PATCH 4/5] ALSA: bcd2000: Make local data static Takashi Iwai
2015-05-26 12:41 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432644112-16543-6-git-send-email-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.