Commit f52720ca authored by Panagiotis Issaris's avatar Panagiotis Issaris Committed by Linus Torvalds

[PATCH] fs: Removing useless casts

* Removing useless casts
* Removing useless wrapper
* Conversion from kmalloc+memset to kzalloc
Signed-off-by: default avatarPanagiotis Issaris <takis@issaris.org>
Acked-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f8314dc6
...@@ -513,7 +513,7 @@ static int coda_venus_readdir(struct file *filp, filldir_t filldir, ...@@ -513,7 +513,7 @@ static int coda_venus_readdir(struct file *filp, filldir_t filldir,
ino_t ino; ino_t ino;
int ret, i; int ret, i;
vdir = (struct venus_dirent *)kmalloc(sizeof(*vdir), GFP_KERNEL); vdir = kmalloc(sizeof(*vdir), GFP_KERNEL);
if (!vdir) return -ENOMEM; if (!vdir) return -ENOMEM;
i = filp->f_pos; i = filp->f_pos;
......
...@@ -89,8 +89,8 @@ ext2_acl_to_disk(const struct posix_acl *acl, size_t *size) ...@@ -89,8 +89,8 @@ ext2_acl_to_disk(const struct posix_acl *acl, size_t *size)
size_t n; size_t n;
*size = ext2_acl_size(acl->a_count); *size = ext2_acl_size(acl->a_count);
ext_acl = (ext2_acl_header *)kmalloc(sizeof(ext2_acl_header) + ext_acl = kmalloc(sizeof(ext2_acl_header) + acl->a_count *
acl->a_count * sizeof(ext2_acl_entry), GFP_KERNEL); sizeof(ext2_acl_entry), GFP_KERNEL);
if (!ext_acl) if (!ext_acl)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
ext_acl->a_version = cpu_to_le32(EXT2_ACL_VERSION); ext_acl->a_version = cpu_to_le32(EXT2_ACL_VERSION);
......
...@@ -90,8 +90,8 @@ ext3_acl_to_disk(const struct posix_acl *acl, size_t *size) ...@@ -90,8 +90,8 @@ ext3_acl_to_disk(const struct posix_acl *acl, size_t *size)
size_t n; size_t n;
*size = ext3_acl_size(acl->a_count); *size = ext3_acl_size(acl->a_count);
ext_acl = (ext3_acl_header *)kmalloc(sizeof(ext3_acl_header) + ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count *
acl->a_count * sizeof(ext3_acl_entry), GFP_KERNEL); sizeof(ext3_acl_entry), GFP_KERNEL);
if (!ext_acl) if (!ext_acl)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION); ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION);
......
...@@ -439,8 +439,8 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, ...@@ -439,8 +439,8 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
if ((err = ext3_reserve_inode_write(handle, inode, &iloc))) if ((err = ext3_reserve_inode_write(handle, inode, &iloc)))
goto exit_dindj; goto exit_dindj;
n_group_desc = (struct buffer_head **)kmalloc((gdb_num + 1) * n_group_desc = kmalloc((gdb_num + 1) * sizeof(struct buffer_head *),
sizeof(struct buffer_head *), GFP_KERNEL); GFP_KERNEL);
if (!n_group_desc) { if (!n_group_desc) {
err = -ENOMEM; err = -ENOMEM;
ext3_warning (sb, __FUNCTION__, ext3_warning (sb, __FUNCTION__,
......
...@@ -76,7 +76,7 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe ...@@ -76,7 +76,7 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe
return NULL; return NULL;
} }
qbh->data = data = (char *)kmalloc(2048, GFP_NOFS); qbh->data = data = kmalloc(2048, GFP_NOFS);
if (!data) { if (!data) {
printk("HPFS: hpfs_map_4sectors: out of memory\n"); printk("HPFS: hpfs_map_4sectors: out of memory\n");
goto bail; goto bail;
......
...@@ -652,7 +652,7 @@ jffs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) ...@@ -652,7 +652,7 @@ jffs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
lock_kernel(); lock_kernel();
D3({ D3({
char *s = (char *)kmalloc(len + 1, GFP_KERNEL); char *s = kmalloc(len + 1, GFP_KERNEL);
memcpy(s, name, len); memcpy(s, name, len);
s[len] = '\0'; s[len] = '\0';
printk("jffs_lookup(): dir: 0x%p, name: \"%s\"\n", dir, s); printk("jffs_lookup(): dir: 0x%p, name: \"%s\"\n", dir, s);
...@@ -1173,8 +1173,8 @@ jffs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) ...@@ -1173,8 +1173,8 @@ jffs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
lock_kernel(); lock_kernel();
D1({ D1({
int len = dentry->d_name.len; int len = dentry->d_name.len;
char *_name = (char *)kmalloc(len + 1, GFP_KERNEL); char *_name = kmalloc(len + 1, GFP_KERNEL);
char *_symname = (char *)kmalloc(symname_len + 1, GFP_KERNEL); char *_symname = kmalloc(symname_len + 1, GFP_KERNEL);
memcpy(_name, dentry->d_name.name, len); memcpy(_name, dentry->d_name.name, len);
_name[len] = '\0'; _name[len] = '\0';
memcpy(_symname, symname, symname_len); memcpy(_symname, symname, symname_len);
...@@ -1282,7 +1282,7 @@ jffs_create(struct inode *dir, struct dentry *dentry, int mode, ...@@ -1282,7 +1282,7 @@ jffs_create(struct inode *dir, struct dentry *dentry, int mode,
lock_kernel(); lock_kernel();
D1({ D1({
int len = dentry->d_name.len; int len = dentry->d_name.len;
char *s = (char *)kmalloc(len + 1, GFP_KERNEL); char *s = kmalloc(len + 1, GFP_KERNEL);
memcpy(s, dentry->d_name.name, len); memcpy(s, dentry->d_name.name, len);
s[len] = '\0'; s[len] = '\0';
printk("jffs_create(): dir: 0x%p, name: \"%s\"\n", dir, s); printk("jffs_create(): dir: 0x%p, name: \"%s\"\n", dir, s);
......
...@@ -488,13 +488,11 @@ jffs_create_file(struct jffs_control *c, ...@@ -488,13 +488,11 @@ jffs_create_file(struct jffs_control *c,
{ {
struct jffs_file *f; struct jffs_file *f;
if (!(f = (struct jffs_file *)kmalloc(sizeof(struct jffs_file), if (!(f = kzalloc(sizeof(*f), GFP_KERNEL))) {
GFP_KERNEL))) {
D(printk("jffs_create_file(): Failed!\n")); D(printk("jffs_create_file(): Failed!\n"));
return NULL; return NULL;
} }
no_jffs_file++; no_jffs_file++;
memset(f, 0, sizeof(struct jffs_file));
f->ino = raw_inode->ino; f->ino = raw_inode->ino;
f->pino = raw_inode->pino; f->pino = raw_inode->pino;
f->nlink = raw_inode->nlink; f->nlink = raw_inode->nlink;
...@@ -516,7 +514,7 @@ jffs_create_control(struct super_block *sb) ...@@ -516,7 +514,7 @@ jffs_create_control(struct super_block *sb)
D2(printk("jffs_create_control()\n")); D2(printk("jffs_create_control()\n"));
if (!(c = (struct jffs_control *)kmalloc(s, GFP_KERNEL))) { if (!(c = kmalloc(s, GFP_KERNEL))) {
goto fail_control; goto fail_control;
} }
DJM(no_jffs_control++); DJM(no_jffs_control++);
...@@ -524,7 +522,7 @@ jffs_create_control(struct super_block *sb) ...@@ -524,7 +522,7 @@ jffs_create_control(struct super_block *sb)
c->gc_task = NULL; c->gc_task = NULL;
c->hash_len = JFFS_HASH_SIZE; c->hash_len = JFFS_HASH_SIZE;
s = sizeof(struct list_head) * c->hash_len; s = sizeof(struct list_head) * c->hash_len;
if (!(c->hash = (struct list_head *)kmalloc(s, GFP_KERNEL))) { if (!(c->hash = kmalloc(s, GFP_KERNEL))) {
goto fail_hash; goto fail_hash;
} }
DJM(no_hash++); DJM(no_hash++);
...@@ -593,8 +591,7 @@ jffs_add_virtual_root(struct jffs_control *c) ...@@ -593,8 +591,7 @@ jffs_add_virtual_root(struct jffs_control *c)
D2(printk("jffs_add_virtual_root(): " D2(printk("jffs_add_virtual_root(): "
"Creating a virtual root directory.\n")); "Creating a virtual root directory.\n"));
if (!(root = (struct jffs_file *)kmalloc(sizeof(struct jffs_file), if (!(root = kmalloc(sizeof(struct jffs_file), GFP_KERNEL))) {
GFP_KERNEL))) {
return -ENOMEM; return -ENOMEM;
} }
no_jffs_file++; no_jffs_file++;
......
...@@ -94,8 +94,7 @@ jffs_build_begin(struct jffs_control *c, int unit) ...@@ -94,8 +94,7 @@ jffs_build_begin(struct jffs_control *c, int unit)
struct mtd_info *mtd; struct mtd_info *mtd;
D3(printk("jffs_build_begin()\n")); D3(printk("jffs_build_begin()\n"));
fmc = (struct jffs_fmcontrol *)kmalloc(sizeof(struct jffs_fmcontrol), fmc = kmalloc(sizeof(*fmc), GFP_KERNEL);
GFP_KERNEL);
if (!fmc) { if (!fmc) {
D(printk("jffs_build_begin(): Allocation of " D(printk("jffs_build_begin(): Allocation of "
"struct jffs_fmcontrol failed!\n")); "struct jffs_fmcontrol failed!\n"));
...@@ -486,8 +485,7 @@ jffs_add_node(struct jffs_node *node) ...@@ -486,8 +485,7 @@ jffs_add_node(struct jffs_node *node)
D3(printk("jffs_add_node(): ino = %u\n", node->ino)); D3(printk("jffs_add_node(): ino = %u\n", node->ino));
ref = (struct jffs_node_ref *)kmalloc(sizeof(struct jffs_node_ref), ref = kmalloc(sizeof(*ref), GFP_KERNEL);
GFP_KERNEL);
if (!ref) if (!ref)
return -ENOMEM; return -ENOMEM;
......
...@@ -282,7 +282,7 @@ int txInit(void) ...@@ -282,7 +282,7 @@ int txInit(void)
TxLockVHWM = (nTxLock * 8) / 10; TxLockVHWM = (nTxLock * 8) / 10;
size = sizeof(struct tblock) * nTxBlock; size = sizeof(struct tblock) * nTxBlock;
TxBlock = (struct tblock *) vmalloc(size); TxBlock = vmalloc(size);
if (TxBlock == NULL) if (TxBlock == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -307,7 +307,7 @@ int txInit(void) ...@@ -307,7 +307,7 @@ int txInit(void)
* tlock id = 0 is reserved. * tlock id = 0 is reserved.
*/ */
size = sizeof(struct tlock) * nTxLock; size = sizeof(struct tlock) * nTxLock;
TxLock = (struct tlock *) vmalloc(size); TxLock = vmalloc(size);
if (TxLock == NULL) { if (TxLock == NULL) {
vfree(TxBlock); vfree(TxBlock);
return -ENOMEM; return -ENOMEM;
......
...@@ -100,7 +100,7 @@ static struct nlm_lockowner *nlm_find_lockowner(struct nlm_host *host, fl_owner_ ...@@ -100,7 +100,7 @@ static struct nlm_lockowner *nlm_find_lockowner(struct nlm_host *host, fl_owner_
res = __nlm_find_lockowner(host, owner); res = __nlm_find_lockowner(host, owner);
if (res == NULL) { if (res == NULL) {
spin_unlock(&host->h_lock); spin_unlock(&host->h_lock);
new = (struct nlm_lockowner *)kmalloc(sizeof(*new), GFP_KERNEL); new = kmalloc(sizeof(*new), GFP_KERNEL);
spin_lock(&host->h_lock); spin_lock(&host->h_lock);
res = __nlm_find_lockowner(host, owner); res = __nlm_find_lockowner(host, owner);
if (res == NULL && new != NULL) { if (res == NULL && new != NULL) {
......
...@@ -48,7 +48,7 @@ static int ncp_symlink_readpage(struct file *file, struct page *page) ...@@ -48,7 +48,7 @@ static int ncp_symlink_readpage(struct file *file, struct page *page)
char *buf = kmap(page); char *buf = kmap(page);
error = -ENOMEM; error = -ENOMEM;
rawlink=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_KERNEL); rawlink = kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_KERNEL);
if (!rawlink) if (!rawlink)
goto fail; goto fail;
...@@ -126,7 +126,7 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) { ...@@ -126,7 +126,7 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
/* EPERM is returned by VFS if symlink procedure does not exist */ /* EPERM is returned by VFS if symlink procedure does not exist */
return -EPERM; return -EPERM;
rawlink=(char *)kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_KERNEL); rawlink = kmalloc(NCP_MAX_SYMLINK_SIZE, GFP_KERNEL);
if (!rawlink) if (!rawlink)
return -ENOMEM; return -ENOMEM;
......
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
#include "delegation.h" #include "delegation.h"
#include "internal.h" #include "internal.h"
static struct nfs_delegation *nfs_alloc_delegation(void)
{
return (struct nfs_delegation *)kmalloc(sizeof(struct nfs_delegation), GFP_KERNEL);
}
static void nfs_free_delegation(struct nfs_delegation *delegation) static void nfs_free_delegation(struct nfs_delegation *delegation)
{ {
if (delegation->cred) if (delegation->cred)
...@@ -124,7 +119,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct ...@@ -124,7 +119,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR))) if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR)))
__nfs_revalidate_inode(NFS_SERVER(inode), inode); __nfs_revalidate_inode(NFS_SERVER(inode), inode);
delegation = nfs_alloc_delegation(); delegation = kmalloc(sizeof(*delegation), GFP_KERNEL);
if (delegation == NULL) if (delegation == NULL)
return -ENOMEM; return -ENOMEM;
memcpy(delegation->stateid.data, res->delegation.data, memcpy(delegation->stateid.data, res->delegation.data,
......
...@@ -443,7 +443,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str ...@@ -443,7 +443,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str
{ {
struct nfs_open_context *ctx; struct nfs_open_context *ctx;
ctx = (struct nfs_open_context *)kmalloc(sizeof(*ctx), GFP_KERNEL); ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
if (ctx != NULL) { if (ctx != NULL) {
atomic_set(&ctx->count, 1); atomic_set(&ctx->count, 1);
ctx->dentry = dget(dentry); ctx->dentry = dget(dentry);
......
...@@ -449,7 +449,7 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr ...@@ -449,7 +449,7 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr
struct nfs_fattr res; struct nfs_fattr res;
} *ptr; } *ptr;
ptr = (struct unlinkxdr *)kmalloc(sizeof(*ptr), GFP_KERNEL); ptr = kmalloc(sizeof(*ptr), GFP_KERNEL);
if (!ptr) if (!ptr)
return -ENOMEM; return -ENOMEM;
ptr->arg.fh = NFS_FH(dir->d_inode); ptr->arg.fh = NFS_FH(dir->d_inode);
......
...@@ -352,7 +352,7 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr * ...@@ -352,7 +352,7 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *
{ {
struct nfs_diropargs *arg; struct nfs_diropargs *arg;
arg = (struct nfs_diropargs *)kmalloc(sizeof(*arg), GFP_KERNEL); arg = kmalloc(sizeof(*arg), GFP_KERNEL);
if (!arg) if (!arg)
return -ENOMEM; return -ENOMEM;
arg->fh = NFS_FH(dir->d_inode); arg->fh = NFS_FH(dir->d_inode);
......
...@@ -1149,8 +1149,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -1149,8 +1149,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
* Allocate a buffer to store the current name being processed * Allocate a buffer to store the current name being processed
* converted to format determined by current NLS. * converted to format determined by current NLS.
*/ */
name = (u8*)kmalloc(NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1, name = kmalloc(NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1, GFP_NOFS);
GFP_NOFS);
if (unlikely(!name)) { if (unlikely(!name)) {
err = -ENOMEM; err = -ENOMEM;
goto err_out; goto err_out;
...@@ -1191,7 +1190,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -1191,7 +1190,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
* map the mft record without deadlocking. * map the mft record without deadlocking.
*/ */
rc = le32_to_cpu(ctx->attr->data.resident.value_length); rc = le32_to_cpu(ctx->attr->data.resident.value_length);
ir = (INDEX_ROOT*)kmalloc(rc, GFP_NOFS); ir = kmalloc(rc, GFP_NOFS);
if (unlikely(!ir)) { if (unlikely(!ir)) {
err = -ENOMEM; err = -ENOMEM;
goto err_out; goto err_out;
......
...@@ -137,7 +137,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na) ...@@ -137,7 +137,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
BUG_ON(!na->name); BUG_ON(!na->name);
i = na->name_len * sizeof(ntfschar); i = na->name_len * sizeof(ntfschar);
ni->name = (ntfschar*)kmalloc(i + sizeof(ntfschar), GFP_ATOMIC); ni->name = kmalloc(i + sizeof(ntfschar), GFP_ATOMIC);
if (!ni->name) if (!ni->name)
return -ENOMEM; return -ENOMEM;
memcpy(ni->name, na->name, i); memcpy(ni->name, na->name, i);
......
...@@ -331,7 +331,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref, ...@@ -331,7 +331,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
ntfs_inode **tmp; ntfs_inode **tmp;
int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *); int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *);
tmp = (ntfs_inode **)kmalloc(new_size, GFP_NOFS); tmp = kmalloc(new_size, GFP_NOFS);
if (unlikely(!tmp)) { if (unlikely(!tmp)) {
ntfs_error(base_ni->vol->sb, "Failed to allocate " ntfs_error(base_ni->vol->sb, "Failed to allocate "
"internal buffer."); "internal buffer.");
...@@ -2893,7 +2893,7 @@ int ntfs_extent_mft_record_free(ntfs_inode *ni, MFT_RECORD *m) ...@@ -2893,7 +2893,7 @@ int ntfs_extent_mft_record_free(ntfs_inode *ni, MFT_RECORD *m)
if (!(base_ni->nr_extents & 3)) { if (!(base_ni->nr_extents & 3)) {
int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode*); int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode*);
extent_nis = (ntfs_inode**)kmalloc(new_size, GFP_NOFS); extent_nis = kmalloc(new_size, GFP_NOFS);
if (unlikely(!extent_nis)) { if (unlikely(!extent_nis)) {
ntfs_error(vol->sb, "Failed to allocate internal " ntfs_error(vol->sb, "Failed to allocate internal "
"buffer during rollback.%s", es); "buffer during rollback.%s", es);
......
...@@ -350,7 +350,7 @@ int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins, ...@@ -350,7 +350,7 @@ int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins,
} }
if (!ns) { if (!ns) {
ns_len = ins_len * NLS_MAX_CHARSET_SIZE; ns_len = ins_len * NLS_MAX_CHARSET_SIZE;
ns = (unsigned char*)kmalloc(ns_len + 1, GFP_NOFS); ns = kmalloc(ns_len + 1, GFP_NOFS);
if (!ns) if (!ns)
goto mem_err_out; goto mem_err_out;
} }
...@@ -365,7 +365,7 @@ retry: wc = nls->uni2char(le16_to_cpu(ins[i]), ns + o, ...@@ -365,7 +365,7 @@ retry: wc = nls->uni2char(le16_to_cpu(ins[i]), ns + o,
else if (wc == -ENAMETOOLONG && ns != *outs) { else if (wc == -ENAMETOOLONG && ns != *outs) {
unsigned char *tc; unsigned char *tc;
/* Grow in multiples of 64 bytes. */ /* Grow in multiples of 64 bytes. */
tc = (unsigned char*)kmalloc((ns_len + 64) & tc = kmalloc((ns_len + 64) &
~63, GFP_NOFS); ~63, GFP_NOFS);
if (tc) { if (tc) {
memcpy(tc, ns, ns_len); memcpy(tc, ns, ns_len);
......
...@@ -370,7 +370,7 @@ xfs_file_readdir( ...@@ -370,7 +370,7 @@ xfs_file_readdir(
/* Try fairly hard to get memory */ /* Try fairly hard to get memory */
do { do {
if ((read_buf = (caddr_t)kmalloc(rlen, GFP_KERNEL))) if ((read_buf = kmalloc(rlen, GFP_KERNEL)))
break; break;
rlen >>= 1; rlen >>= 1;
} while (rlen >= 1024); } while (rlen >= 1024);
......
...@@ -553,13 +553,13 @@ xfs_vn_follow_link( ...@@ -553,13 +553,13 @@ xfs_vn_follow_link(
ASSERT(dentry); ASSERT(dentry);
ASSERT(nd); ASSERT(nd);
link = (char *)kmalloc(MAXPATHLEN+1, GFP_KERNEL); link = kmalloc(MAXPATHLEN+1, GFP_KERNEL);
if (!link) { if (!link) {
nd_set_link(nd, ERR_PTR(-ENOMEM)); nd_set_link(nd, ERR_PTR(-ENOMEM));
return NULL; return NULL;
} }
uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL); uio = kmalloc(sizeof(uio_t), GFP_KERNEL);
if (!uio) { if (!uio) {
kfree(link); kfree(link);
nd_set_link(nd, ERR_PTR(-ENOMEM)); nd_set_link(nd, ERR_PTR(-ENOMEM));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment