summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/floppy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 671a0ae434b4..fee57f7f3821 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3233,8 +3233,10 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g,
3233 int cnt; 3233 int cnt;
3234 3234
3235 /* sanity checking for parameters. */ 3235 /* sanity checking for parameters. */
3236 if (g->sect <= 0 || 3236 if ((int)g->sect <= 0 ||
3237 g->head <= 0 || 3237 (int)g->head <= 0 ||
3238 /* check for overflow in max_sector */
3239 (int)(g->sect * g->head) <= 0 ||
3238 /* check for zero in F_SECT_PER_TRACK */ 3240 /* check for zero in F_SECT_PER_TRACK */
3239 (unsigned char)((g->sect << 2) >> FD_SIZECODE(g)) == 0 || 3241 (unsigned char)((g->sect << 2) >> FD_SIZECODE(g)) == 0 ||
3240 g->track <= 0 || g->track > UDP->tracks >> STRETCH(g) || 3242 g->track <= 0 || g->track > UDP->tracks >> STRETCH(g) ||