mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sanjay Singh Rawat <snjsrwt@gmail.com>
To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: balbi@ti.com, andrzej.p@samsung.com, mina86@mina86.com,
	Sanjay Singh Rawat <snjsrwt@gmail.com>
Subject: [PATCH] usb: gadget: f_mass_storage: restore address range on exit
Date: Fri,  5 Dec 2014 16:51:30 +0530	[thread overview]
Message-ID: <1417778490-20723-1-git-send-email-snjsrwt@gmail.com> (raw)

At the start of the thread we are changing the address limit, restoring it
to the default while exiting.

Signed-off-by: Sanjay Singh Rawat <snjsrwt@gmail.com>
---
 drivers/usb/gadget/function/f_mass_storage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 811929c..c4a2ded 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -2489,6 +2489,7 @@ static void handle_exception(struct fsg_common *common)
 static int fsg_main_thread(void *common_)
 {
 	struct fsg_common	*common = common_;
+	mm_segment_t fs = get_fs();
 
 	/*
 	 * Allow the thread to be killed by a signal, but set the signal mask
@@ -2567,6 +2568,7 @@ static int fsg_main_thread(void *common_)
 		up_write(&common->filesem);
 	}
 
+	set_fs(fs);
 	/* Let fsg_unbind() know the thread has exited */
 	complete_and_exit(&common->thread_notifier, 0);
 }
-- 
1.8.3.2


             reply	other threads:[~2014-12-05 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 11:21 Sanjay Singh Rawat [this message]
2014-12-05 19:34 ` Alan Stern

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=1417778490-20723-1-git-send-email-snjsrwt@gmail.com \
    --to=snjsrwt@gmail.com \
    --cc=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mina86@mina86.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®