Skip to content

Commit d0c4471

Browse files
rostedtEric Van Hensbergen
authored andcommitted
9p: fix flags length in net
Some files in the net/9p directory uses "int" for flags. This can cause hard to find bugs on some architectures. This patch converts the flags to use "long" instead. This bug was discovered by doing an allyesconfig make on the -rt kernel where checks are done to ensure all flags are of size sizeof(long). Signed-off-by: Steven Rostedt <srostedt@redhat.com> Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
1 parent 728fc4e commit d0c4471

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

net/9p/trans_virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static void p9_virtio_close(struct p9_trans *trans)
201201
{
202202
struct virtio_chan *chan = trans->priv;
203203
int count;
204-
unsigned int flags;
204+
unsigned long flags;
205205

206206
spin_lock_irqsave(&chan->lock, flags);
207207
p9_idpool_destroy(chan->tagpool);

net/9p/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int p9_idpool_get(struct p9_idpool *p)
8888
{
8989
int i = 0;
9090
int error;
91-
unsigned int flags;
91+
unsigned long flags;
9292

9393
retry:
9494
if (idr_pre_get(&p->pool, GFP_KERNEL) == 0)
@@ -120,7 +120,7 @@ EXPORT_SYMBOL(p9_idpool_get);
120120

121121
void p9_idpool_put(int id, struct p9_idpool *p)
122122
{
123-
unsigned int flags;
123+
unsigned long flags;
124124
spin_lock_irqsave(&p->lock, flags);
125125
idr_remove(&p->pool, id);
126126
spin_unlock_irqrestore(&p->lock, flags);

0 commit comments

Comments
 (0)