Skip to content

Commit

Permalink
[ARM] vfp: fix leak of VFP_NAN_FLAG into FPSCR
Browse files Browse the repository at this point in the history
The VFP code can leak VFP_NAN_FLAG into the FPSCR. It doesn't correspond
to any real FPSCR bit (and overlaps one of the exception flags).

Bug report from Daniel Jacobowitz

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Apr 25, 2006
1 parent c7fd844 commit 928bd1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/arm/vfp/vfpdouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exce
dd, d, exceptions);
vfp_put_double(dd, d);
}
return exceptions & ~VFP_NAN_FLAG;
return exceptions;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs)
* emulate it.
*/
}
return exceptions;
return exceptions & ~VFP_NAN_FLAG;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/vfp/vfpsingle.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exce
vfp_put_float(sd, d);
}

return exceptions & ~VFP_NAN_FLAG;
return exceptions;
}

/*
Expand Down

0 comments on commit 928bd1b

Please sign in to comment.