mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-20 22:26:23 +00:00
scst: Add a kmalloc_array() backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6638 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -401,6 +401,15 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page,
|
||||
(__flags), NULL, NULL)
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
|
||||
static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
|
||||
{
|
||||
if (size != 0 && n > ULONG_MAX / size)
|
||||
return NULL;
|
||||
return kmalloc(n * size, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/t10-pi.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
|
||||
|
||||
Reference in New Issue
Block a user