The following issues were found

Documentation/target/tcm_mod_builder.py
1 issues
Missing parentheses in call to 'print'. Did you mean print(msg)? (<unknown>, line 23)
Error

Line: 23 Column: 9

              fabric_mod_init_port = ""

def tcm_mod_err(msg):
	print msg
	sys.exit(1)

def tcm_mod_create_module_subdir(fabric_mod_dir_var):

	if os.path.isdir(fabric_mod_dir_var) == True:

            

Reported by Pylint.

arch/powerpc/kvm/book3s_64_mmu_hv.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 1987 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              	unsigned long	hpt_index;
	int		chars_left;
	int		buf_index;
	char		buf[64];
};

static int debugfs_htab_open(struct inode *inode, struct file *file)
{
	struct kvm *kvm = inode->i_private;

            

Reported by FlawFinder.

arch/powerpc/kvm/book3s_64_mmu_radix.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 1252 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              	int		lpid;
	int		chars_left;
	int		buf_index;
	char		buf[128];
	u8		hdr;
};

static int debugfs_radix_open(struct inode *inode, struct file *file)
{

            

Reported by FlawFinder.

arch/powerpc/kernel/watchdog.c
1 issues
Using argument flags that points at uninitialized variable flags
Error

Line: 99 CWE codes: 908

              	 * This may be called from low level interrupt handlers at some
	 * point in future.
	 */
	raw_local_irq_save(*flags);
	hard_irq_disable(); /* Make it soft-NMI safe */
	while (unlikely(test_and_set_bit_lock(0, &__wd_smp_lock))) {
		raw_local_irq_restore(*flags);
		spin_until_cond(!test_bit(0, &__wd_smp_lock));
		raw_local_irq_save(*flags);

            

Reported by Cppcheck.

arch/powerpc/kernel/traps.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 1029 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              			((u64 *)vdst)[i] = cpu_to_le64(((u64 *)vbuf)[i]);
		break;
	case 3: /* lxvb16x */
		memcpy(vdst, vbuf, 16);
		break;
	}
#endif /* !__LITTLE_ENDIAN__ */

	/* Go to next instruction */

            

Reported by FlawFinder.

arch/powerpc/kvm/book3s_hv_builtin.c
1 issues
Subtracting pointers that point to different objects
Error

Line: 170 CWE codes: 570

              int kvmppc_hcall_impl_hv_realmode(unsigned long cmd)
{
	cmd /= 4;
	if (cmd < hcall_real_table_end - hcall_real_table &&
	    hcall_real_table[cmd])
		return 1;

	return 0;
}

            

Reported by Cppcheck.

arch/powerpc/kvm/book3s_hv_rm_mmu.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 973 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              		goto out_unlock;

	/* Copy the page */
	memcpy((void *)dest_pa, (void *)src_pa, SZ_4K);

	kvmppc_update_dirty_map(dest_memslot, dest >> PAGE_SHIFT, PAGE_SIZE);

out_unlock:
	arch_spin_unlock(&kvm->mmu_lock.rlock.raw_lock);

            

Reported by FlawFinder.

arch/powerpc/kernel/trace/ftrace.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 909 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	}

	for (i = 0; i < 2; i++) {
		memcpy(tramp[i], stub_insns, sizeof(stub_insns));
		tramp[i][1] |= PPC_HA(reladdr);
		tramp[i][2] |= PPC_LO(reladdr);
		add_ftrace_tramp((unsigned long)tramp[i]);
	}


            

Reported by FlawFinder.

arch/powerpc/kvm/book3s_pr.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 165 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	if (svcpu->in_use) {
		kvmppc_copy_from_svcpu(vcpu);
	}
	memcpy(to_book3s(vcpu)->slb_shadow, svcpu->slb, sizeof(svcpu->slb));
	to_book3s(vcpu)->slb_shadow_max = svcpu->slb_max;
	svcpu_put(svcpu);
#endif

	if (kvmppc_is_split_real(vcpu))

            

Reported by FlawFinder.

arch/powerpc/kvm/book3s_xive.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 178 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              	/* Each VP has 8 queues though we only provision some */
	struct xive_q		queues[KVMPPC_XIVE_Q_COUNT];
	u32			esc_virq[KVMPPC_XIVE_Q_COUNT];
	char			*esc_virq_names[KVMPPC_XIVE_Q_COUNT];

	/* Stash a delayed irq on restore from migration (see set_icp) */
	u32			delayed_irq;

	/* Stats */

            

Reported by FlawFinder.