cxgb3/l2t: Fix undefined behaviour
The use of zero-sized array causes undefined behaviour when it is not
the last member in a structure. As it happens to be in this case.
Also, the current code makes use of a language extension to the C90
standard, but the preferred mechanism to declare variable-length
types such as this one is a flexible array member, introduced in
C99:
struct foo {
int stuff;
struct boo array[];
};
By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last. Which is beneficial
to cultivate a high-quality code.
Fixes: e48f129c ("[SCSI] cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference")
Signed-off-by:
Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by:
David S. Miller <davem@davemloft.net>
-
mentioned in commit cfb8d781
-
mentioned in commit a1b9b65e
-
mentioned in commit 94bef5d5
-
mentioned in commit 3d87c75d
-
mentioned in commit 3dbae155
-
mentioned in commit e8dc73c9
-
mentioned in commit f36aaf8b
-
mentioned in commit 0a368bf0
-
mentioned in commit 5a58ec8c
-
mentioned in commit e76018cb
-
mentioned in commit a2008395
-
mentioned in commit 1fa0949b
-
mentioned in commit 5299a11a
-
mentioned in commit beb69f15
-
mentioned in commit 1d9e13e8
-
mentioned in commit 7856e9f1
-
mentioned in commit 31232272
-
mentioned in commit 0ead3364
-
mentioned in commit 70f1451e
-
mentioned in commit fe946db6
-
mentioned in commit 5c91aa1d
-
mentioned in commit 19219946
-
mentioned in commit 89f60a5d
-
mentioned in commit 859b4941
-
mentioned in commit 1223f3db
-
mentioned in commit 307ed94c
-
mentioned in commit 4ea19ecf
-
mentioned in commit 13402837
-
mentioned in commit 06ccf63d
-
mentioned in commit 6e88abb8
-
mentioned in commit 16c3380f
-
mentioned in commit 43951585
-
mentioned in commit 9dd8bb5f
-
mentioned in commit d6cdad87
-
mentioned in commit a1c4b924