Commit 1c32ca9f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (38 commits)
  Revert "staging: tidspbridge: replace iommu custom for opensource implementation"
  Revert "staging: tidspbridge - move shared memory iommu maps to tiomap3430.c"
  Revert "staging: tidspbridge - rename bridge_brd_mem_map/unmap to a proper name"
  Revert "staging: tidspbridge - remove custom mmu code from tiomap3430.c"
  Revert "staging: tidspbridge - fix mmufault support"
  Revert "staging: tidspbridge - remove hw directory"
  Revert "staging: tidspbridge - move all iommu related code to a new file"
  Revert "staging: tidspbridge: remove dw_dmmu_base from cfg_hostres struct"
  Revert "staging: tidspbridge - remove reserved memory clean up"
  Revert "staging: tidspbridge - deprecate reserve/unreserve_memory funtions"
  Revert "staging: tidspbridge - remove dmm custom module"
  Revert "staging: tidspbridge - update Kconfig to select IOMMU module"
  staging: tidspbridge: hardcode SCM macros while fix is upstreamed
  Staging: keucr driver: fix uninitialized variable & proper memset length
  omap: dsp: remove shm from normal memory
  Staging: wlan-ng: Fix wrong #ifdef #endif sequence
  Staging: Update parameters for cfg80211 key management operation
  Staging: ath6kl: Fix pointer casts on 64-bit architectures
  Staging: batman-adv: suppress false warning when changing the mac address
  Staging: batman-adv: fix interface alternating and bonding reggression
  ...
parents 00dad7fa 94fb7c9c
......@@ -5676,7 +5676,7 @@ S: Maintained
STAGING SUBSYSTEM
M: Greg Kroah-Hartman <gregkh@suse.de>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-next-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
L: devel@driverdev.osuosl.org
S: Maintained
F: drivers/staging/
......
......@@ -284,12 +284,14 @@ void __init omap_dsp_reserve_sdram_memblock(void)
if (!size)
return;
paddr = __memblock_alloc_base(size, SZ_1M, MEMBLOCK_REAL_LIMIT);
paddr = memblock_alloc(size, SZ_1M);
if (!paddr) {
pr_err("%s: failed to reserve %x bytes\n",
__func__, size);
return;
}
memblock_free(paddr, size);
memblock_remove(paddr, size);
omap_dsp_phys_mempool_base = paddr;
}
......
......@@ -102,7 +102,7 @@ config AR600x_BT_RESET_PIN
config ATH6KL_CFG80211
bool "CFG80211 support"
depends on ATH6K_LEGACY
depends on ATH6K_LEGACY && CFG80211
help
Enables support for CFG80211 APIs. The default option is to use WEXT. Even with this option enabled, WEXT is not explicitly disabled and the onus of not exercising WEXT lies on the application(s) running in the user space.
......
......@@ -1126,7 +1126,7 @@ ar6000_transfer_bin_file(AR_SOFTC_T *ar, AR6K_BIN_FILE file, A_UINT32 address, A
if ((board_ext_address) && (fw_entry->size == (board_data_size + board_ext_data_size))) {
A_UINT32 param;
status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (A_UCHAR *)(((A_UINT32)fw_entry->data) + board_data_size), board_ext_data_size);
status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (A_UCHAR *)(fw_entry->data + board_data_size), board_ext_data_size);
if (status != A_OK) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
......@@ -3030,7 +3030,8 @@ ar6000_data_tx(struct sk_buff *skb, struct net_device *dev)
A_UINT8 csumDest=0;
A_UINT8 csum=skb->ip_summed;
if(csumOffload && (csum==CHECKSUM_PARTIAL)){
csumStart=skb->csum_start-(skb->network_header-skb->head)+sizeof(ATH_LLC_SNAP_HDR);
csumStart = (skb->head + skb->csum_start - skb_network_header(skb) +
sizeof(ATH_LLC_SNAP_HDR));
csumDest=skb->csum_offset+csumStart;
}
#endif
......
......@@ -808,7 +808,7 @@ ar6k_cfg80211_scanComplete_event(AR_SOFTC_T *ar, A_STATUS status)
static int
ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
A_UINT8 key_index, const A_UINT8 *mac_addr,
A_UINT8 key_index, bool pairwise, const A_UINT8 *mac_addr,
struct key_params *params)
{
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(ndev);
......@@ -901,7 +901,7 @@ ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
static int
ar6k_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
A_UINT8 key_index, const A_UINT8 *mac_addr)
A_UINT8 key_index, bool pairwise, const A_UINT8 *mac_addr)
{
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(ndev);
......@@ -936,7 +936,8 @@ ar6k_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
static int
ar6k_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
A_UINT8 key_index, const A_UINT8 *mac_addr, void *cookie,
A_UINT8 key_index, bool pairwise, const A_UINT8 *mac_addr,
void *cookie,
void (*callback)(void *cookie, struct key_params*))
{
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(ndev);
......
......@@ -165,7 +165,7 @@ static void update_mac_addresses(struct batman_if *batman_if)
batman_if->net_dev->dev_addr, ETH_ALEN);
}
static void check_known_mac_addr(uint8_t *addr)
static void check_known_mac_addr(struct net_device *net_dev)
{
struct batman_if *batman_if;
......@@ -175,11 +175,16 @@ static void check_known_mac_addr(uint8_t *addr)
(batman_if->if_status != IF_TO_BE_ACTIVATED))
continue;
if (!compare_orig(batman_if->net_dev->dev_addr, addr))
if (batman_if->net_dev == net_dev)
continue;
if (!compare_orig(batman_if->net_dev->dev_addr,
net_dev->dev_addr))
continue;
pr_warning("The newly added mac address (%pM) already exists "
"on: %s\n", addr, batman_if->net_dev->name);
"on: %s\n", net_dev->dev_addr,
batman_if->net_dev->name);
pr_warning("It is strongly recommended to keep mac addresses "
"unique to avoid problems!\n");
}
......@@ -430,7 +435,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
atomic_set(&batman_if->refcnt, 0);
hardif_hold(batman_if);
check_known_mac_addr(batman_if->net_dev->dev_addr);
check_known_mac_addr(batman_if->net_dev);
spin_lock(&if_list_lock);
list_add_tail_rcu(&batman_if->list, &if_list);
......@@ -515,7 +520,7 @@ static int hard_if_event(struct notifier_block *this,
goto out;
}
check_known_mac_addr(batman_if->net_dev->dev_addr);
check_known_mac_addr(batman_if->net_dev);
update_mac_addresses(batman_if);
bat_priv = netdev_priv(batman_if->soft_iface);
......
......@@ -1000,10 +1000,10 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
/* find a suitable router for this originator, and use
* bonding if possible. */
struct neigh_node *find_router(struct orig_node *orig_node,
struct neigh_node *find_router(struct bat_priv *bat_priv,
struct orig_node *orig_node,
struct batman_if *recv_if)
{
struct bat_priv *bat_priv;
struct orig_node *primary_orig_node;
struct orig_node *router_orig;
struct neigh_node *router, *first_candidate, *best_router;
......@@ -1019,13 +1019,9 @@ struct neigh_node *find_router(struct orig_node *orig_node,
/* without bonding, the first node should
* always choose the default router. */
if (!recv_if)
return orig_node->router;
bat_priv = netdev_priv(recv_if->soft_iface);
bonding_enabled = atomic_read(&bat_priv->bonding_enabled);
if (!bonding_enabled)
if ((!recv_if) && (!bonding_enabled))
return orig_node->router;
router_orig = orig_node->router->orig_node;
......@@ -1154,7 +1150,7 @@ static int route_unicast_packet(struct sk_buff *skb,
orig_node = ((struct orig_node *)
hash_find(bat_priv->orig_hash, unicast_packet->dest));
router = find_router(orig_node, recv_if);
router = find_router(bat_priv, orig_node, recv_if);
if (!router) {
spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags);
......
......@@ -38,8 +38,8 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if);
int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if);
int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if);
struct neigh_node *find_router(struct orig_node *orig_node,
struct batman_if *recv_if);
struct neigh_node *find_router(struct bat_priv *bat_priv,
struct orig_node *orig_node, struct batman_if *recv_if);
void update_bonding_candidates(struct bat_priv *bat_priv,
struct orig_node *orig_node);
......
......@@ -224,7 +224,7 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
if (!orig_node)
orig_node = transtable_search(bat_priv, ethhdr->h_dest);
router = find_router(orig_node, NULL);
router = find_router(bat_priv, orig_node, NULL);
if (!router)
goto unlock;
......
......@@ -1001,13 +1001,15 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
}
#endif
case IOCTL_BE_BUCKET_SIZE:
Adapter->BEBucketSize = *(PULONG)arg;
Status = STATUS_SUCCESS;
Status = 0;
if (get_user(Adapter->BEBucketSize, (unsigned long __user *)arg))
Status = -EFAULT;
break;
case IOCTL_RTPS_BUCKET_SIZE:
Adapter->rtPSBucketSize = *(PULONG)arg;
Status = STATUS_SUCCESS;
Status = 0;
if (get_user(Adapter->rtPSBucketSize, (unsigned long __user *)arg))
Status = -EFAULT;
break;
case IOCTL_CHIP_RESET:
{
......@@ -1028,11 +1030,15 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
case IOCTL_QOS_THRESHOLD:
{
USHORT uiLoopIndex;
for(uiLoopIndex = 0 ; uiLoopIndex < NO_OF_QUEUES ; uiLoopIndex++)
{
Adapter->PackInfo[uiLoopIndex].uiThreshold = *(PULONG)arg;
Status = 0;
for (uiLoopIndex = 0; uiLoopIndex < NO_OF_QUEUES; uiLoopIndex++) {
if (get_user(Adapter->PackInfo[uiLoopIndex].uiThreshold,
(unsigned long __user *)arg)) {
Status = -EFAULT;
break;
}
}
Status = STATUS_SUCCESS;
break;
}
......@@ -1093,7 +1099,8 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
}
case IOCTL_BCM_GET_CURRENT_STATUS:
{
LINK_STATE *plink_state = NULL;
LINK_STATE plink_state;
/* Copy Ioctl Buffer structure */
if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
......@@ -1101,13 +1108,19 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
Status = -EFAULT;
break;
}
plink_state = (LINK_STATE*)arg;
plink_state->bIdleMode = (UCHAR)Adapter->IdleMode;
plink_state->bShutdownMode = Adapter->bShutStatus;
plink_state->ucLinkStatus = (UCHAR)Adapter->LinkStatus;
if(copy_to_user(IoBuffer.OutputBuffer,
(PUCHAR)plink_state, (UINT)IoBuffer.OutputLength))
{
if (IoBuffer.OutputLength != sizeof(plink_state)) {
Status = -EINVAL;
break;
}
if (copy_from_user(&plink_state, (void __user *)arg, sizeof(plink_state))) {
Status = -EFAULT;
break;
}
plink_state.bIdleMode = (UCHAR)Adapter->IdleMode;
plink_state.bShutdownMode = Adapter->bShutStatus;
plink_state.ucLinkStatus = (UCHAR)Adapter->LinkStatus;
if (copy_to_user(IoBuffer.OutputBuffer, &plink_state, IoBuffer.OutputLength)) {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy_to_user Failed..\n");
Status = -EFAULT;
break;
......@@ -1331,7 +1344,9 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Copy From User space failed. status :%d", Status);
return -EFAULT;
}
uiSectorSize = *((PUINT)(IoBuffer.InputBuffer)); /* FIXME: unchecked __user access */
if (get_user(uiSectorSize, (unsigned int __user *)IoBuffer.InputBuffer))
return -EFAULT;
if((uiSectorSize < MIN_SECTOR_SIZE) || (uiSectorSize > MAX_SECTOR_SIZE))
{
......
......@@ -90,5 +90,5 @@ Contact Info:
=============
Brett Rudley brudley@broadcom.com
Henry Ptasinski henryp@broadcom.com
Nohee Ko noheek@broadcom.com
Dowan Kim dowan@broadcom.com
......@@ -45,5 +45,5 @@ Contact
=====
Brett Rudley <brudley@broadcom.com>
Henry Ptasinski <henryp@broadcom.com>
Nohee Ko <noheek@broadcom.com>
Dowan Kim <dowan@broadcom.com>
......@@ -2222,8 +2222,6 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
ASSERT(net);
ASSERT(!net->netdev_ops);
net->netdev_ops = &dhd_ops_virt;
net->netdev_ops = &dhd_ops_pri;
/*
......
......@@ -95,12 +95,12 @@ static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx);
static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params);
static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr);
u8 key_idx, bool pairwise, const u8 *mac_addr);
static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
u8 key_idx, bool pairwise, const u8 *mac_addr,
void *cookie, void (*callback) (void *cookie,
struct
key_params *
......@@ -1615,7 +1615,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
static s32
wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
struct wl_wsec_key key;
......@@ -1700,7 +1700,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
static s32
wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr)
u8 key_idx, bool pairwise, const u8 *mac_addr)
{
struct wl_wsec_key key;
s32 err = 0;
......@@ -1756,7 +1756,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
static s32
wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr, void *cookie,
u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
void (*callback) (void *cookie, struct key_params * params))
{
struct key_params params;
......
......@@ -3184,13 +3184,9 @@ static int cpia_open(struct file *file)
goto oops;
}
err = -EINTR;
if(signal_pending(current))
goto oops;
/* Set ownership of /proc/cpia/videoX to current user */
if(cam->proc_entry)
cam->proc_entry->uid = current_uid();
cam->proc_entry->uid = current_euid();
/* set mark for loading first frame uncompressed */
cam->first_frame = 1;
......
......@@ -286,7 +286,6 @@ int ft1000_CreateDevice(struct ft1000_device *dev)
pid = kernel_thread (exec_mknod, (void *)info, 0);
// initialize application information
info->appcnt = 0;
// if (ft1000_flarion_cnt == 0) {
//
......
......@@ -211,9 +211,6 @@ static void heartbeat_onchannelcallback(void *context)
DPRINT_DBG(VMBUS, "heartbeat packet: len=%d, requestid=%lld",
recvlen, requestid);
icmsghdrp = (struct icmsg_hdr *)&buf[
sizeof(struct vmbuspipe_hdr)];
icmsghdrp = (struct icmsg_hdr *)&buf[
sizeof(struct vmbuspipe_hdr)];
......
......@@ -244,12 +244,12 @@ static int intel_sst_mmap_play_capture(u32 str_id,
int retval, i;
struct stream_info *stream;
struct snd_sst_mmap_buff_entry *buf_entry;
struct snd_sst_mmap_buff_entry *tmp_buf;
pr_debug("sst:called for str_id %d\n", str_id);
retval = sst_validate_strid(str_id);
if (retval)
return -EINVAL;
BUG_ON(!mmap_buf);
stream = &sst_drv_ctx->streams[str_id];
if (stream->mmapped != true)
......@@ -262,14 +262,24 @@ static int intel_sst_mmap_play_capture(u32 str_id,
stream->curr_bytes = 0;
stream->cumm_bytes = 0;
tmp_buf = kcalloc(mmap_buf->entries, sizeof(*tmp_buf), GFP_KERNEL);
if (!tmp_buf)
return -ENOMEM;
if (copy_from_user(tmp_buf, (void __user *)mmap_buf->buff,
mmap_buf->entries * sizeof(*tmp_buf))) {
retval = -EFAULT;
goto out_free;
}
pr_debug("sst:new buffers count %d status %d\n",
mmap_buf->entries, stream->status);
buf_entry = mmap_buf->buff;
buf_entry = tmp_buf;
for (i = 0; i < mmap_buf->entries; i++) {
BUG_ON(!buf_entry);
bufs = kzalloc(sizeof(*bufs), GFP_KERNEL);
if (!bufs)
return -ENOMEM;
if (!bufs) {
retval = -ENOMEM;
goto out_free;
}
bufs->size = buf_entry->size;
bufs->offset = buf_entry->offset;
bufs->addr = sst_drv_ctx->mmap_mem;
......@@ -293,13 +303,15 @@ static int intel_sst_mmap_play_capture(u32 str_id,
if (sst_play_frame(str_id) < 0) {
pr_warn("sst: play frames fail\n");
mutex_unlock(&stream->lock);
return -EIO;
retval = -EIO;
goto out_free;
}
} else if (stream->ops == STREAM_OPS_CAPTURE) {
if (sst_capture_frame(str_id) < 0) {
pr_warn("sst: capture frame fail\n");
mutex_unlock(&stream->lock);
return -EIO;
retval = -EIO;
goto out_free;
}
}
}
......@@ -314,6 +326,9 @@ static int intel_sst_mmap_play_capture(u32 str_id,
if (retval >= 0)
retval = stream->cumm_bytes;
pr_debug("sst:end of play/rec ioctl bytes = %d!!\n", retval);
out_free:
kfree(tmp_buf);
return retval;
}
......@@ -377,7 +392,7 @@ static int snd_sst_fill_kernel_list(struct stream_info *stream,
{
struct sst_stream_bufs *stream_bufs;
unsigned long index, mmap_len;
unsigned char *bufp;
unsigned char __user *bufp;
unsigned long size, copied_size;
int retval = 0, add_to_list = 0;
static int sent_offset;
......@@ -512,9 +527,7 @@ static int snd_sst_copy_userbuf_capture(struct stream_info *stream,
/* copy to user */
list_for_each_entry_safe(entry, _entry,
copy_to_list, node) {
if (copy_to_user((void *)
iovec[entry->iov_index].iov_base +
entry->iov_offset,
if (copy_to_user(iovec[entry->iov_index].iov_base + entry->iov_offset,
kbufs->addr + entry->offset,
entry->size)) {
/* Clean up the list and return error */
......@@ -590,7 +603,7 @@ static int intel_sst_read_write(unsigned int str_id, char __user *buf,
buf, (int) count, (int) stream->status);
stream->buf_type = SST_BUF_USER_STATIC;
iovec.iov_base = (void *)buf;
iovec.iov_base = buf;
iovec.iov_len = count;
nr_segs = 1;
......@@ -838,7 +851,7 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
break;
case _IOC_NR(SNDRV_SST_STREAM_SET_PARAMS): {
struct snd_sst_params *str_param = (struct snd_sst_params *)arg;
struct snd_sst_params str_param;
pr_debug("sst: IOCTL_SET_PARAMS recieved!\n");
if (minor != STREAM_MODULE) {
......@@ -846,17 +859,25 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
break;
}
if (copy_from_user(&str_param, (void __user *)arg,
sizeof(str_param))) {
retval = -EFAULT;
break;
}
if (!str_id) {
retval = sst_get_stream(str_param);
retval = sst_get_stream(&str_param);
if (retval > 0) {
struct stream_info *str_info;
char __user *dest;
sst_drv_ctx->stream_cnt++;
data->str_id = retval;
str_info = &sst_drv_ctx->streams[retval];
str_info->src = SST_DRV;
retval = copy_to_user(&str_param->stream_id,
&retval, sizeof(__u32));
dest = (char __user *)arg + offsetof(struct snd_sst_params, stream_id);
retval = copy_to_user(dest, &retval, sizeof(__u32));
if (retval)
retval = -EFAULT;
} else {
......@@ -866,16 +887,14 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
} else {
pr_debug("sst: SET_STREAM_PARAMS recieved!\n");
/* allocated set params only */
retval = sst_set_stream_param(str_id, str_param);
retval = sst_set_stream_param(str_id, &str_param);
/* Block the call for reply */
if (!retval) {
int sfreq = 0, word_size = 0, num_channel = 0;
sfreq = str_param->sparams.uc.pcm_params.sfreq;
word_size = str_param->sparams.
uc.pcm_params.pcm_wd_sz;
num_channel = str_param->
sparams.uc.pcm_params.num_chan;
if (str_param->ops == STREAM_OPS_CAPTURE) {
sfreq = str_param.sparams.uc.pcm_params.sfreq;
word_size = str_param.sparams.uc.pcm_params.pcm_wd_sz;
num_channel = str_param.sparams.uc.pcm_params.num_chan;
if (str_param.ops == STREAM_OPS_CAPTURE) {
sst_drv_ctx->scard_ops->\
set_pcm_audio_params(sfreq,
word_size, num_channel);
......@@ -885,41 +904,39 @@ long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd, unsigned long arg)
break;
}
case _IOC_NR(SNDRV_SST_SET_VOL): {
struct snd_sst_vol *set_vol;
struct snd_sst_vol *rec_vol = (struct snd_sst_vol *)arg;
struct snd_sst_vol set_vol;
if (copy_from_user(&set_vol, (void __user *)arg,
sizeof(set_vol))) {
pr_debug("sst: copy failed\n");
retval = -EFAULT;
break;
}
pr_debug("sst: SET_VOLUME recieved for %d!\n",
rec_vol->stream_id);
if (minor == STREAM_MODULE && rec_vol->stream_id == 0) {
set_vol.stream_id);
if (minor == STREAM_MODULE && set_vol.stream_id == 0) {
pr_debug("sst: invalid operation!\n");
retval = -EPERM;
break;
}
set_vol = kzalloc(sizeof(*set_vol), GFP_ATOMIC);
if (!set_vol) {
pr_debug("sst: mem allocation failed\n");
retval = -ENOMEM;
break;
}
if (copy_from_user(set_vol, rec_vol, sizeof(*set_vol))) {
pr_debug("sst: copy failed\n");
retval = -EFAULT;
break;
}
retval = sst_set_vol(set_vol);
kfree(set_vol);
retval = sst_set_vol(&set_vol);
break;
}
case _IOC_NR(SNDRV_SST_GET_VOL): {
struct snd_sst_vol *rec_vol = (struct snd_sst_vol *)arg;
struct snd_sst_vol get_vol;
if (copy_from_user(&get_vol, (void __user *)arg,
sizeof(get_vol))) {
retval = -EFAULT;
break;
}
pr_debug("sst: IOCTL_GET_VOLUME recieved for stream = %d!\n",
rec_vol->stream_id);
if (minor == STREAM_MODULE && rec_vol->stream_id == 0) {
get_vol.stream_id);
if (minor == STREAM_MODULE && get_vol.stream_id == 0) {
pr_debug("sst: invalid operation!\n");
retval = -EPERM;
break;
}