/* * Copyright (C) 2012 Fujitsu. All rights reserved. * Written by Miao Xie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 021110-1307, USA. */ #ifndef __BTRFS_MATH_H #define __BTRFS_MATH_H #include static inline u64 div_factor(u64 num, int factor) { if (factor == 10) return num; num *= factor; return div_u64(num, 10); } static inline u64 div_factor_fine(u64 num, int factor) { if (factor == 100) return num; num *= factor; return div_u64(num, 100); } #endif leanup net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2016-12-01 19:23:31 +0530
committerKalle Valo <kvalo@codeaurora.org>2016-12-30 13:19:40 +0200
commit74c8719b8ee0922593a5cbec0bd6127d86d8a2f4 (patch)
tree25744644e81f296298a2419398072cd0a42f5ff0 /net/bluetooth
parentd15697de60db5570532fdedb8e13b2251d65b8e3 (diff)
mwifiex: sdio: fix use after free issue for save_adapter
If we have sdio work requests received when sdio card reset is happening, we may end up accessing older save_adapter pointer later which is already freed during card reset. This patch solves the problem by cancelling those pending requests. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'net/bluetooth')