Author: Adrian Bunk <bunk@kernel.org>
This patch fixes a negative array index spotted by the Coverity checker.
Changes-licensed-under: ISC
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
                        (channel->center_freq >= 5260 ? 1 :
                            (channel->center_freq > 4000 ? 0 : -1)));
 
+               if (obdb == -1)
+                       return -EINVAL;
+
                if (!ath5k_hw_rfregs_op(rf, ah->ah_offset[6],
                                ee->ee_ob[ee_mode][obdb], 3, 279, 0, true))
                        return -EINVAL;