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

vme: 8-bit status/id takes 256 values, not 255

Fixes an off by one array size.

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Kalinkin and committed by
Greg Kroah-Hartman
ad1bfe41 37784706

+6 -1
+3 -1
drivers/vme/vme_bridge.h
··· 1 1 #ifndef _VME_BRIDGE_H_ 2 2 #define _VME_BRIDGE_H_ 3 3 4 + #include <linux/vme.h> 5 + 4 6 #define VME_CRCSR_BUF_SIZE (508*1024) 5 7 /* 6 8 * Resource structures ··· 90 88 91 89 struct vme_irq { 92 90 int count; 93 - struct vme_callback callback[255]; 91 + struct vme_callback callback[VME_NUM_STATUSID]; 94 92 }; 95 93 96 94 /* Allow 16 characters for name (including null character) */
+3
include/linux/vme.h
··· 81 81 82 82 extern struct bus_type vme_bus_type; 83 83 84 + /* Number of VME interrupt vectors */ 85 + #define VME_NUM_STATUSID 256 86 + 84 87 /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */ 85 88 #define VME_MAX_BRIDGES (sizeof(unsigned int)*8) 86 89 #define VME_MAX_SLOTS 32