Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide-floppy: zero out the whole struct ide_atapi_pc on init

This is a precaution just to make sure a new pc is clean when allocated.

There should be no functional change introduced by this patch.

[bart: ported it over IDE changes]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by

Borislav Petkov and committed by
Bartlomiej Zolnierkiewicz
68dc3575 c96a7df8

+1 -4
+1 -4
drivers/ide/ide-floppy.c
··· 351 351 352 352 static void idefloppy_init_pc(struct ide_atapi_pc *pc) 353 353 { 354 - memset(pc->c, 0, 12); 355 - pc->retries = 0; 356 - pc->flags = 0; 357 - pc->req_xfer = 0; 354 + memset(pc, 0, sizeof(*pc)); 358 355 pc->buf = pc->pc_buf; 359 356 pc->buf_size = IDEFLOPPY_PC_BUFFER_SIZE; 360 357 pc->callback = ide_floppy_callback;